I have the following code sequences whose pourpose is to display a .txt file in a Excel Spreadsheet, however the .txt file is not being loaded after I execute workbooks.opentext
a workbook is loaded but there are no sheets displayed let alone text
I get good return codes from IDispatch->invoke and good return codes in excpInfo
I have changed the file name to a bogous name and the same thing happens
Then you should provide a LPCTSTR in your call, rather than providing a LPCSTR, and then telling the compiler to ignore the fact that the string may not be in the correct format. Lookup the use of the TEXT() macro and make sure your strings are generated correctly, and read the documentation on the correct use of casts.
I think the string I am passing is being interpetted correctly
By luck, not judgement; if your project is built in UNICODE mode then it will be wrong. You should not use a cast unless you understand the consequences. Instead, use the TEXT() macro to ensure that your character string is generated in the appropriate character set to match the build. Your cast in the foregoing code is telling the compiler to ignore the fact that the string may be in the wrong character set.
Use the best guess
Last Visit: 31-Dec-99 18:00 Last Update: 27-May-17 23:30