This post is an act of DESPERATION.
This is code I have written and used for years and now, out of the blue, I cannot open an existing XL file.
The code is the traditional:
LongFileName1 opens just fine.
LongFileName2 produces the eOleException.
LongFileName2 has a Type of .C01 which is an output from a neural network program and is in Excel 4.0 format.
I have done the following to try and find this error:
1) Check existence of file in the code preceeding the above.
2) Opened LongFileName by navigating to its directory in Explorer, double clicking on it, and successfully having Excel open it. (I have Type .C01 setup to be opened by Excel. This has worked for many years for me.)
3) reduced the length of the full path LongFileName which is around 200 characters long. I deal with long paths/filenames all the time in this code and I am confident I am shorter than ones that work OK.
The fact that the file does exist and can be opened by doubled clicking but yet, cannot be opened by this old code is mind-boggling.
I am open to all suggestions no matter how obvious or cryptic.
The only debugging method I know of now is "verbose:" Create a test program with the code above where the files are nice short path/names. Show that works, and then step by step begin modifying the working code to the exact code I have now that doesn't work. At some point, I'll do a step that produces the error.
I really hate to have to spend the time to eek this out - unfortunately I'm in melt down mode and haven't seen daylight in days.
Thanks in advance,
Regards,
Tom
This is code I have written and used for years and now, out of the blue, I cannot open an existing XL file.
The code is the traditional:
Code:
Excel: = CreateOleObject (' excel.application ');
...
Excel. Workbooks. Open (LongFileName1);
...
Excel. Workbooks. Open (LongFileName2);
LongFileName1 opens just fine.
LongFileName2 produces the eOleException.
LongFileName2 has a Type of .C01 which is an output from a neural network program and is in Excel 4.0 format.
I have done the following to try and find this error:
1) Check existence of file in the code preceeding the above.
2) Opened LongFileName by navigating to its directory in Explorer, double clicking on it, and successfully having Excel open it. (I have Type .C01 setup to be opened by Excel. This has worked for many years for me.)
3) reduced the length of the full path LongFileName which is around 200 characters long. I deal with long paths/filenames all the time in this code and I am confident I am shorter than ones that work OK.
The fact that the file does exist and can be opened by doubled clicking but yet, cannot be opened by this old code is mind-boggling.
I am open to all suggestions no matter how obvious or cryptic.
The only debugging method I know of now is "verbose:" Create a test program with the code above where the files are nice short path/names. Show that works, and then step by step begin modifying the working code to the exact code I have now that doesn't work. At some point, I'll do a step that produces the error.
I really hate to have to spend the time to eek this out - unfortunately I'm in melt down mode and haven't seen daylight in days.
Thanks in advance,
Regards,
Tom