헤더 파일에
#import "C:\Program Files\Common Files\Microsoft Shared\Office12\MSO.DLL" rename("RGB","_RGB")
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
#import "C:\\Program Files\\Microsoft Office\\Office11\\EXCEL.EXE" \
rename("RGB","_RGB") \
rename("DialogBox","_DialogBox") \
rename("CopyFile","_CopyFile") \
rename("ReplaceText","_ReplaceText") \
exclude("IFont","IPicture","_IMsoDispObj")
....
실제로 사용하는 코드 예시 :
Excel::_ApplicationPtr m_Excel;
m_Excel.CreateInstance(L"Excel.Application");
m_Excel->put_Visible(0, VARIANT_TRUE);
Excel::WorkbooksPtr books = m_Excel->Workbooks;
m_Workbook = books->Add();
m_Worksheet = m_Workbook->Worksheets->Add();
반응형