false.xls

G

Guest

I have an agent in Lotus Notes with the following code:
'******************************************
Dim Excel As Variant
Dim xlWorkbook As Variant
Dim xlSheet As Variant
xlFilename = "C:\GS-35F-4415G.mht"
Set Excel = CreateObject( "Excel.Application" )
Excel.Visible = True '// display the Excel window
Excel.Workbooks.Open xlFilename '// Open the Excel file
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
Chdir "C:\"
xlWorkbook.SaveAs Filename="C:\GS-35F-4415G.csv",_
FileFormat=xlCSVMSDOS,CreateBackup=False
Call xlWorkbook.close
Call excel.Quit
'*******************************************
Here is what I'm trying to do:
Pull in a file named ......"C:\GS-35F-4415G.mht"
Save it as a CSV file......"C:\GS-35F-4415G.csv"
Open the CSV file and run some macros to clean up the data and the save it

Here is what happens:
First run ...............no errors but file is not generated.
Second run........... error message appears stating false.xls has already
been created.
I look in the root, no file. I looked in "my documents" and sure enough the
false.xls
is there. This file has nothing at all to do with my data.
If I delete this file and run the agent again ......no error but it does
create the false.xls in the "my documents" folder.

Any ideas??

Thanks in advance!!
 
G

Gary Keramidas

if i change this lines, it seems to save ok for me, i added a colon.

xlWorkbook.SaveAs Filename:="C:\GS-35F-4415G1.csv"
 
G

Gary Keramidas

should have mentioned i put colons after each option, before the =

xWorkbook.SaveAs Filename:="C:\GS-35F-4415G.csv", FileFormat:=xlCSVMSDOS,
CreateBackup:=False
 
D

Dave Peterson

Then drop the keywords and just use the positional parameters:

I looked in VBA's help (xl2003) for .saveas and saw this:

expression.SaveAs(FileName, FileFormat, Password, WriteResPassword,
ReadOnlyRecommended, CreateBackup, AccessMode,
ConflictResolution, AddToMru, TextCodepage,
TextVisualLayout, Local)

So your code:
xlWorkbook.SaveAs Filename="C:\GS-35F-4415G.csv", _
FileFormat=xlCSVMSDOS,CreateBackup=False

would look like:

xlWorkbook.SaveAs "C:\GS-35F-4415G.csv", 24, , , , False

I'd bet that xlCSVMSDOS won't work within your LotusScript, too.

ps. Very good eyes, Gary!
 
G

Gary Keramidas

since i know nothing about lotus script, would filename & chr(58) & = work?
(to use a comma)
 
G

Guest

Worked like a champ!!!!!!!!!!!

Thanks to all




Dave Peterson said:
Then drop the keywords and just use the positional parameters:

I looked in VBA's help (xl2003) for .saveas and saw this:

expression.SaveAs(FileName, FileFormat, Password, WriteResPassword,
ReadOnlyRecommended, CreateBackup, AccessMode,
ConflictResolution, AddToMru, TextCodepage,
TextVisualLayout, Local)

So your code:
xlWorkbook.SaveAs Filename="C:\GS-35F-4415G.csv", _
FileFormat=xlCSVMSDOS,CreateBackup=False

would look like:

xlWorkbook.SaveAs "C:\GS-35F-4415G.csv", 24, , , , False

I'd bet that xlCSVMSDOS won't work within your LotusScript, too.

ps. Very good eyes, Gary!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top