#include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object Local $oExcel = _Excel_Open() If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = @ScriptDir & "\Extras\_Excel1.xls" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example 1", "Error opening '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example 1", "Workbook '" & $sWorkbook & "' has been opened successfully." & @CRLF & @CRLF & "Creation Date: " & $oWorkbook.BuiltinDocumentProperties("Creation Date").Value)
举报
Local $Excel_File = FileOpenDialog("浏览EXCEL格式", "", "EXCEL2010格式(*.xlsx)|EXCEL2007以下格式(*.xls)", 1) Local $Path1 = StringRegExp($Excel_File, '.+\\', 3) Local $Path2 = StringRegExpReplace($Excel_File, '.+\\', '') Local $Excel_Path = $Path1[0] & '~$' & $Path2 If FileExists($file) Then MsgBox(0, '', 'ok') Else MsgBox(0, '', 'no') EndIf
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2025-8-2 10:19 , Processed in 0.232983 second(s), 23 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2025 Discuz! Team.