关于EXCEL的问题!

sunnyqcy 2006-10-12 08:55:15
请问如何可以读出一个EXCEL工作簿中包含的SHEET的名称?
...全文
166 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
do2008 2006-10-14
  • 打赏
  • 举报
回复
学习~~~
hk_c 2006-10-14
  • 打赏
  • 举报
回复
mark 学习
daydayup234 2006-10-12
  • 打赏
  • 举报
回复
void __fastcall TForm1::Button1Click(TObject *Sender)
{
WideString theXls;
theXls=ExtractFilePath(Application->ExeName) +"myExcel.xls";
if(!FileExists(theXls)){ShowMessage("µ±Ç°Ä¿Â¼ÏÂtheXls.xls²»´æÔÚÎļþ");return;}
TCOM_Application iExcelApp; //#include <Excel_2k.h>
try{iExcelApp=CoExcelApplication::Create();}
catch(...) {ShowMessage("Æô¶¯ Excel ³ö´í, ´ó¸ÅÊÇûװExcel");return;}
iExcelApp->set_Visible(0,true);
iExcelApp->get_Workbooks()->Open(theXls.c_bstr(),TNoParam(),TVariant(true),TNoParam(),TNoParam(),
TNoParam(),TNoParam(),TNoParam(),TNoParam(),TNoParam(),TNoParam(),TNoParam(),TNoParam(),0);
_WorksheetPtr isheetCOMPtr;
isheetCOMPtr=iExcelApp->get_ActiveWorkbook()->get_ActiveSheet();
ShowMessage(isheetCOMPtr->get_Name());
isheetCOMPtr->Release();
iExcelApp->Quit();
}

13,824

社区成员

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

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