file convert vbscript - Lotus to Excel - TechRepublic
General discussion
July 13, 2004 at 12:35 AM
johan101

file convert vbscript – Lotus to Excel

by johan101 . Updated 21 years, 12 months ago

Hi
I’m writing a script to convert all my *.wk* and *.123 file to *.xls format
it searches directories and sub directories for the files , opens them and saves them in xls format.
it does not want to work.
its about 866+ files in different directories that I need to convert before end of month

all help is apreciated

thanks in advance

dim fso, ws, OFFICE_PATH, Result, file
filename=”*.wk*”
startDir=”c:\lotus\work\123\”
Set ws = CreateObject(“Scripting.FileSystemObject”)
Set folder = ws.GetFolder(startDir)
fList(folder)
wscript.quit
sub fList(folderObj)
for each file in folderObj.Files
if file.name=filename then

Set ws = WScript.CreateObject(“WScript.Shell”)

OFFICE_PATH = “C:\lotus\123”

ws.Run CHR(34)& OFFICE_PATH & “\123w.exe” & CHR(34) & file, 0, “FALSE”

WScript.Sleep 1500
ws.SendKeys “%(f)”
ws.SendKeys “a”
Result = Replace (file, “wk4”, “xls”)
ws.SendKeys Result
WScript.Sleep 1000
ws.Sendkeys “%(s)”
ws.Sendkeys “%{F4}”

exit for
end if
next
for each folder in folderObj.subfolders
fList(folder)
next
end sub

This discussion is locked

All Comments