Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Automation - loading text files
Hi,
I am trying to load a csv file in excel. I am using the "OpenText" method so that I can format particular columns to text format. The code which I am using is : pRet = application.GetWorkbooks(); ASSERT( pRet != NULL ); workbooks.AttachDispatch(pRet); workbooks.OpenText(LPCTSTR(csvfile),COleVariant("1 "),COleVariant("3"), COleVariant("xlDelimited"),1, COleVariant("False"),COleVariant("False"),COleVari ant("False"), COleVariant("True"),COleVariant("False"),COleVaria nt("False"), COleVariant("NULL"),COleVariant("Array(Array(3,2), Array(4,2))"),COleVariant("NULL"));*/ It should be noted that I am trying to format the 3rd and the 4th column to text format. This code gives me an error : _OpenText method of Workbooks class failed Maybe one of you can see what I am doing wrong here. Thanks, Varsha Kashyap |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
column widths change when loading customer Excel files | Excel Discussion (Misc queries) | |||
trouble loading excel files | Excel Discussion (Misc queries) | |||
Loading Excel files | Setting up and Configuration of Excel | |||
How do I stop virus scans when loading existing Excel files?? | Excel Worksheet Functions | |||
Excel automation "Error loading DLL" | Excel Programming |