Hi,I wanna operate the excel file in MFC project.And I use excel2010 in win7 system.So I clicked Project->Add Class->TypeLib Class,add six interfaces,_Application,_Workbook,Workbooks,_Worksheet,Worksheets,Font,Range.I deleted all #import that TypeLib wizard produced,and add sth on the top of file like this:
#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE14\MSO.dll" \
rename("RGB","MSRGB"),\
rename("DocumentProperties","JOEDocumentProperties")
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" raw_interfaces_only,\
rename("Reference","ignorethis"),rename("VBE", "JOEVBE")
#import "C:\Program Files\Microsoft Office\OFFICE14\excel.exe" exclude("IFont","IPicture") \
rename("RGB","ignorethis"),rename("DialogBox", "ignorethis"),\
rename("VBE","JOEVBE"), rename("ReplaceText","JOEReplaceText"),\
rename("CopyFile","JOECopyFile"),rename("FindText","JOEFindText"),rename("NoPrompt", "JOENoPrompt")
using namespace Office;
using namespace VBIDE;
using namespace Excel;
But there still exist 24 errors which are following:
error C2872: “Application”: ambiguous symbol
maybe Excel::Application
or VBIDE::Application
error C2259: “Excel::Filter”: cannot instantiate abstract class due to following members
“HRESULT IUnknown::QueryInterface(const IID &,void **)”: is abstract
refer to the declare of “IUnknown::QueryInterface”
***************
What's wrong with my code??