Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 05 DEC 2008 04:24:45PM W Shepard wrote:

I'm writing a CSV file from OI and using OLE to open it.

Then I use OleCallMethod(osheet,'SAVEAS','C:\Myfile.xls') to save it, and I get a file named 'MyFile.xls' that is just the same text as I originally wrote out. It's not a true xls file.

I tried OleCallMethod(osheet,'SAVEAS','C:\Myfile.xls',-4143) but this didn't save anything at all. The second parameter of the SaveAs method is supposed to be filetype and the xlNormal value is -4143, so I was really optimistic that this would work.

I tried naming my CSV file, "Myfile.xls" as some on this board have suggested but Excel seems to be too smart be fooled into formatting it as an Excel file. It opens a single column of text.

How does one change the format of the file programmatically?

Thanks,

Wayne


At 06 DEC 2008 08:02PM Leon wrote:

Why do you say it is not a true excel file?


At 07 DEC 2008 12:40AM Bob Carten wrote:

Wayne:

You can load tab delimited data to the clipboard, then paste to excel. That should save as xls. See the example posted here

- Bob


At 09 DEC 2008 02:55PM W Shepard wrote:

Because it is not a BIFF format file. It is the same comma-delimited format I originally provided with the file extension ".xls" in a silly attempt to "fool" Bill.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/af807bc09da855c38525751600759f9d.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1