Article ID: 115343
Article Last Modified on 10/11/2006
Sub LotusConverter()
'Set "filenam" to the first matching file in the current folder.
filenam = Dir("*.wk*")
'Loop to open each matching file in the current folder.
Do While Len(filenam) > 0
On Error Resume Next
'Opens the file.
Workbooks.Open Filename:=filenam
'Continues execution if there was no error opening the file.
If Err = 0 Then
'Creates "newname" based on original Lotus file name.
newnam = Left(filenam, InStr(1, filenam, ".") - 1) & ".xls"
'Saves the new file as a Microsoft Excel normal file.
ActiveWorkbook.SaveAs Filename:=newnam, FileFormat:=xlNormal
'Closes the current file.
ActiveWorkbook.Close
Else
'Display message if opening filenam was unsuccessful.
MsgBox "Unable to Open file: " & CurDir() & "\" & filenam
'Resets error checking.
Err = 0
End If
'Gets the next file name
filenam = Dir()
'Repeats the loop for all matching files in the current folder.
Loop
End Sub
Before you run the macro, make sure the folder where the Lotus 1-2-3 files
are located is set as the current folder. In Microsoft Excel 97, on the
Tools menu, point to Macro, and click Macros. Then, click LotusConverter in
the list of macros, and click Run. In Microsoft Excel version 5.0 or 7.0,
on the Tools menu, click Macro, click LotusConverter in the list of macros,
and then click Run.
Additional query words: 97 batch converter multiple files XL
Keywords: kbprogramming KB115343