1,注释掉每个头文件的
#import “C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE” no_namespace,
2,在添加的头文件中每个里面都加入#include<afxdisp.h>
3,然后在CRange.h中的 VARIANT DialogBox() 改成 VARIANT _DialogBox()
4.在stdafx.h文件中,添加#include "CApplication.h"
#include "CRange.h"
#include "CWorkbook.h"
#include "CWorkbooks.h"
#include "CWorksheet.h"
#include "CWorksheets.h"