Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
column widths change when loading customer Excel files crdman1 Excel Discussion (Misc queries) 0 April 20th 09 07:42 PM
trouble loading excel files Lonnie Excel Discussion (Misc queries) 0 February 5th 09 05:28 PM
Loading Excel files Guy Coleman Setting up and Configuration of Excel 2 March 14th 07 09:58 PM
How do I stop virus scans when loading existing Excel files?? C. A. Brown Excel Worksheet Functions 1 December 23rd 04 05:27 PM
Excel automation "Error loading DLL" Paul Hewson Excel Programming 0 January 5th 04 08:34 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"