Discussion Locked

file convert vbscript - Lotus to Excel

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

2 replies

by johan101

Fixed it
Unfortunately the code is to long to post here
email me at: secureit (at) gawab.com
to get your copy

This discussion is closed to new replies.