Thanks!!!! I am trying to convert alot of lotus files to
excel.
If yes:
Option Explicit
Sub BulkConvert()
Dim InFileNames As Variant
Dim OutFileName As String
Dim fCtr As Long
Dim tempWkbk As Workbook
InFileNames = Application.GetOpenFilename _
(FileFilter:="Lotus WK? Files ,*.wk*", MultiSelect:=True)
Application.ScreenUpdating = False
If IsArray(InFileNames) Then
For fCtr = LBound(InFileNames) To UBound(InFileNames)
If LCase(Right(InFileNames(fCtr), 4)) Like ".wk?" Then
Application.StatusBar = "processing: " & InFileNames(fCtr)
Set tempWkbk = Workbooks.Open(Filename:=InFileNames(fCtr))
OutFileName = Left(InFileNames(fCtr), _
Len(InFileNames(fCtr)) - 4) & ".xls"
Application.DisplayAlerts = False
tempWkbk.SaveAs Filename:=OutFileName, FileFormat:=xlNormal
Application.DisplayAlerts = True
tempWkbk.Close savechanges:=False
Else
Beep
MsgBox "Just .wk? files, please!" & vbLf & _
InFileNames(fCtr) & " Not converted!"
End If
Next fCtr
Else
MsgBox "No file selected"
End If
With Application
.StatusBar = False
.ScreenUpdating = True
End With
End Sub
Start a new workbook.
Hit alt-f11 to get to the vbe
hit ctrl-R to see the project explorer
Find your project.
It should look like: VBAProject (book1)
right click on it and choose insert|module
Paste that code into the right hand window.
Alt-F11 to go back to Excel
Save this file with a nice name.
Now back to excel.
View|toolbars
show the Forms toolbar
click on the icon that looks like a button.
Drag a nice big button on the worksheet. When you let go, you'll be prompted
for a macro to assign. Choose the one you just pasted in (bulkconvert)
Edit the button's caption (and add some instructions so you remember what this
is used for on the worksheet).
When ever you want to convert some workbooks, open this file, click on the
button and select your files.
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Dave Peterson
ec3...@msn.com