Gilgamesh
2012-03-02 23:57:41 UTC
All,
I have a console app I created in VC++ 2010. I've got it working.
Basically it processes a spreadsheet of data, transmogrifies the data,
then writes it out to another spreadsheet. That's all working. Now I
want to tidy things up. In particular when I open the input
spreadsheet, I'd like to be able to use a file open dialog to navigate
to the file.
I'm doing this:
//MicroSoft Office Objects
#import \
"C:\\Program Files (x86)\Common Files\Microsoft Shared
\OFFICE14\mso.dll" \
rename("DocumentProperties", "DocumentPropertiesXL") \
rename("RGB", "RBGXL")
//Microsoft VBA Objects
#import \
"C:\\Program Files (x86)\Common Files\Microsoft Shared\VBA
\VBA6\vbe6ext.olb"
//Excel Application Objects
#import "C:\\Program Files (x86)\Microsoft Office\OFFICE14\EXCEL.EXE"
\
rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL") \
rename("DocumentProperties", "DocumentPropertiesXL") \
rename("ReplaceText", "ReplaceTextXL") \
rename("CopyFile", "CopyFileXL") \
exclude("IFont", "IPicture") no_dual_interfaces
and later this:
ExcelAppPtr->Workbooks->Open(L"X:\\Awards\\2012\\InputData.xlsx");
It works fine, but I'd like to navigate to the file using a file open
dialog, rather than hardcode the file name or prompt for a string.
Prompting for a string seems error prone and not user friendly. If I
could use a FileOpenDialog then get the string for the file name to
give to the ExcelAppPtr->Workbooks->Open(L"X:\\Awards\\2012\
\InputData.xlsx"); call, the prog would be a lot easier to use.
Any help appreciated.
Mike
I have a console app I created in VC++ 2010. I've got it working.
Basically it processes a spreadsheet of data, transmogrifies the data,
then writes it out to another spreadsheet. That's all working. Now I
want to tidy things up. In particular when I open the input
spreadsheet, I'd like to be able to use a file open dialog to navigate
to the file.
I'm doing this:
//MicroSoft Office Objects
#import \
"C:\\Program Files (x86)\Common Files\Microsoft Shared
\OFFICE14\mso.dll" \
rename("DocumentProperties", "DocumentPropertiesXL") \
rename("RGB", "RBGXL")
//Microsoft VBA Objects
#import \
"C:\\Program Files (x86)\Common Files\Microsoft Shared\VBA
\VBA6\vbe6ext.olb"
//Excel Application Objects
#import "C:\\Program Files (x86)\Microsoft Office\OFFICE14\EXCEL.EXE"
\
rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL") \
rename("DocumentProperties", "DocumentPropertiesXL") \
rename("ReplaceText", "ReplaceTextXL") \
rename("CopyFile", "CopyFileXL") \
exclude("IFont", "IPicture") no_dual_interfaces
and later this:
ExcelAppPtr->Workbooks->Open(L"X:\\Awards\\2012\\InputData.xlsx");
It works fine, but I'd like to navigate to the file using a file open
dialog, rather than hardcode the file name or prompt for a string.
Prompting for a string seems error prone and not user friendly. If I
could use a FileOpenDialog then get the string for the file name to
give to the ExcelAppPtr->Workbooks->Open(L"X:\\Awards\\2012\
\InputData.xlsx"); call, the prog would be a lot easier to use.
Any help appreciated.
Mike