d7调用excel出错not supported by automation object
d7调用excel时出错ethod 'ColumnsWidth' not supported by automation object
var ExcelApp: Variant;
begin
ExcelApp := CreateOleObject( 'Excel.Application' );
ExcelApp.Visible := True;
ExcelApp.Caption := '应用程序调用 Microsoft Excel';
ExcelApp.WorkBooks.Add;
ExcelApp.WorkBooks.Open( 'C:\test1.xls' );
ExcelApp.ActiveSheet.Columns[1].ColumnsWidth := 115;
运行时报错如下:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleError with message 'Method 'ColumnsWidth' not supported by automation object'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
d7调用excel时出错ethod 'ColumnsWidth' not supported by automation object
var ExcelApp: Variant;
begin
ExcelApp := CreateOleObject( 'Excel.Application' );
ExcelApp.Visible := True;
ExcelApp.Caption := '应用程序调用 Microsoft Excel';
ExcelApp.WorkBooks.Add;
ExcelApp.WorkBooks.Open( 'C:\test1.xls' );
ExcelApp.ActiveSheet.Columns[1].ColumnsWidth := 115;
运行时报错如下:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleError with message 'Method 'ColumnsWidth' not supported by automation object'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
解决方案 »
- delphi中有无格式化输入的函数(反Format函数)
- 请问如下的报表应当如何用RAVE 实现
- 菜鸟求救,不在同一个局域网内的两台机器,pc-1(adsl-1)想访问pc-2(adsl-2)的sql-server,应如何实现?不胜感激~~~~~~~~~
- 大家讨论一下是怎么进行盘点的
- 各位高手,帮帮忙!急急急!!
- 【在线等待】C函数转Pascal函数的问题
- 2个查询如何添加到一个临时表
- 关于鼠标和图标在delphi中的应用问题 非常感谢!
- 大家有没有这样的经历?????
- 怎么判断一个表在数据库里是否已经存在
- 求助:这样的数据库我该怎么设计?
- 如何让连接操作不超时!关于ADOConnection
uses里加入, OleServer, Excel97(或excelxp等)没有?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,DB, ComCtrls, Grids, DBGrids, Spin, StdCtrls, Buttons, ExtCtrls,
ActnList, XPMan, Mask, DBCtrls, DBNavPlus, FileCtrl,SHELLAPI,
ComObj,INIFILES, ADODB, OleServer, Excel2000;
希望高手来看一下。