救命啊,急!!!(excel问题)

supercctv 2003-06-14 07:48:44
是这样的,目的是为了打开一个excel文件,读入里面的数据,写入数据库.
查了以前的帖子,
在Form1.h头文件中定义几个变量:
private:
Variant Ex,Wb,Sheet,ERange,EBorders;
并在文件头中包含如下语句:
#include "Excel_2K_SRVR.h"
#include <OleServer.hpp>
在Form1.cpp的文件头中加入
#pragma link "Excel_2K_SRVR"
....
按照上面的做了,结果编译的时候显示:
[C++ Error] ComCtrls.hpp(2638): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
[C++ Error] ComCtrls.hpp(2839): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
[C++ Error] ComCtrls.hpp(3430): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3431): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3435): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3477): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3577): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3640): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3641): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3652): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3657): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3699): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(3706): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] ComCtrls.hpp(4140): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
[C++ Error] ComCtrls.hpp(4259): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
[C++ Error] ComCtrls.hpp(4429): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
[C++ Error] DBCtrls.hpp(1075): E2015 Ambiguity between 'Buttons' and 'Excel_2k::Buttons'
[C++ Error] DBCtrls.hpp(1077): E2015 Ambiguity between 'Buttons' and 'Excel_2k::Buttons'
[C++ Error] DBCtrls.hpp(1096): E2015 Ambiguity between 'Buttons' and 'Excel_2k::Buttons'
[C++ Error] DBGrids.hpp(62): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] DBGrids.hpp(102): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
[C++ Error] DBGrids.hpp(148): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'

怎么办???急大家帮忙哦,!!!
...全文
93 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xujie839997 2003-06-23
  • 打赏
  • 举报
回复
mark
TR@SOE 2003-06-16
  • 打赏
  • 举报
回复
我推荐使用Office控件组进行操作。

我的头文件中是这样的:

ExportFunc.cpp:

#pragma hdrstop

#include "ExportFunc.h"
#include "DM.h"
#include "Excel_2K_SRVR.h"
#include <OleServer.hpp>
#include <fstream>
using std::ofstream;

有时你需要修改一些头文件的包含次序。
yangfan369 2003-06-16
  • 打赏
  • 举报
回复
使用OLE可能会好点
fyje 2003-06-16
  • 打赏
  • 举报
回复
应该是Excel_2k这个文件不在搜索目录下造成的
在环境里面的library path中加入该文件的路径就可以了
我不懂电脑 2003-06-14
  • 打赏
  • 举报
回复
我一般用ExcelApplication这套组件操作。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧