Board index » cppbuilder » Pb with OLE excel Builder6

Pb with OLE excel Builder6


2005-04-19 05:53:16 PM
cppbuilder66
Hello, I've got a problem when I try to open a CSV file using the Excel OLE.
This is my code :
vMSExcel = Variant::CreateObject("Excel.Application");
AnsiString FileName = "C:\\Documents and Settings\\Stagiaire\\Bureau\\stage_pvallet\\maquette_projet\\image\\18_04_05No1.csv";
Variant vFileName = StringToOleStr(FileName);
Variant vNotUsed = Unassigned;
Variant vSeparator = 4;
Variant vXLWorkbooks = vMSExcel.OlePropertyGet("Workbooks");
Variant vXLWorkbook = vXLWorkbooks.OleFunction("Open",vFileName, vNotUsed, vNotUsed,vSeparator);
vMSExcel.OlePropertySet("Visible", true);
Do you see a problem and have you got another solution
sorry for the english but I'm french ;)
Thanks
 
 

Re:Pb with OLE excel Builder6

To have accurate answers you have to provide accurate details...
Where the error (or exception ?) is raised ? What is the exception class ? Message ? and so on...
FB
 

Re:Pb with OLE excel Builder6

Ok sorry The error is on the open function, It return an exception EOleSysError :
An exception occured / has been raised (Une exception s'est produite in french)
 

{smallsort}