View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to use FileConverters?

workbooks.open Filename:="C:\Myfolder\Myfile.dat"

if Excel can open it, it will.

If you can't open it manually by doing File=Open, then you won't be able to
do it in VBA (unless you want to read it in binary using low level file io
and write code to interpret the elements of the file).

The only reason you might want to use the converter property is if Excel
tries to open it with the wrong converter. Then you would look at the array
returned by application.Fileconverters to determine the row number of the
converter you want to use. The converter property tells excel to try that
converter first.

--
Regards,
Tom Ogilvy

"Josh Orfanakis" wrote in message
...
I am trying to understand how to convert files with Excel automation. I
see the parameter in the open method but I don't know what the possible
options are.

There is a readonly property Application.FileConverters but I don't know
how to do anything with that. I am new to VB so that is part of the
problem. VB says the fileconverters is a readonly property
fileconverters[index 1 as object], [index 2 as object], as object.
What does that mean? Is it a 2 dimensional array? How do I know what the
bounds of that are? How can I see what is in each entry?

What I am trying to do is open a non-excel file in excel without any
user interaction.

TIA
JO