Hello!
I try to build (using Visual 2005 and Excel 2007) the example described in the Microsoft Help and Support "How to automate Excel from MFC and Visual C++ 2005 or Visual C++ .NET to fill or obtain data in a range using arrays" (URL: http://support.microso ft.com/kb/308407),
and I run into same problem as described in the MSDN Forums "Newbie Q regarding MFC automation client app" (http://forums.msdn.mic rosoft.com/en-US/vcgeneral/thread/9ae455c1-76fc-40ff-8f8f-d0682597d6a6/)
For solving it as described in the MSDN Forums "using excel type library in vc++2005" (http://forums.msdn.mic rosoft.com/en-US/vcgeneral/thread/1de6c74f-6cf0-4d91-a5a9-e85853b867f6/) ) I replaced the '#import' command in the 'CApplication.h ', 'CRange.h', 'CWorkbook.h', 'CWorksheet.h', 'CWorkbooks.h', 'CWorksheets.h' headers file create by the 'MFC Add Class Wizard' (class wrappers from the type library)
"#import "C:\\Progra m Files\\Microsof t Office\\Office1 2\\EXCEL.EXE" no_namespace" with the following three imports
"#import "C:\\Progra m Files\\Common Files\\Microsof t Shared\\OFFICE1 2\\mso.dll" rename("RGB", "MSRGB")"
"#import "C:\\Progra m Files\\Common Files\\Microsof t Shared\\VBA\\VB A6\\VBE6EXT.OLB " raw_interfaces_ only, rename("Referen ce", "ignorethis "), rename("VBE", "testVBE")"
"#import "C:\\Progra m Files\\Microsof t Office\\OFFICE1 2\\excel.exe" exclude("IFont" , "IPicture") rename("RGB", "ignorethis "), rename("DialogB ox", "ignorethis "), rename("VBE", "testVBE"), rename("Replace Text", "EReplaceText") , rename("CopyFil e","ECopyFile") , rename("FindTex t", "EFindText" ), rename("NoPromp t", "ENoPrompt" )"
but now the compiler doesn't recognized ("error C4430: missing type specifier") to the types 'Application', 'XlCreator', 'Border , 'Interior', 'ChartFormat' locate in the 'CRange.h', 'CWorkbook.h', 'CWorksheet.h', 'CWorkbooks.h', 'CWorksheets.h' headers file!
Can anybody tell me what I do wrong?