#include <Excel.au3>
#include <MsgBoxConstants.au3>
; 创建应用对象
Local $oExcel = _Excel_Open()
If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen 示例", "创建 Excel 应用对象发生错误." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
; *****************************************************************************
; 打开现有工作簿并返回其对象标识符.
; *****************************************************************************
Local $sWorkbook = @ScriptDir & "\Extras\_Excel1.xls"
Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen 示例 1", "打开工作簿发生错误 '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen 示例 1", "工作簿 '" & $sWorkbook & "' 已成功打开." & @CRLF & @CRLF & "[微软]创建日期: " & $oWorkbook.BuiltinDocumentProperties("Creation Date").Value)
帮助文件:
Local $sWorkbook = @ScriptDir & "\Extras\_Excel1.xls"
Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook)
但要打开还有其它办法
|