簡體   English   中英

Autohotkey保存excel文件而看不到覆蓋提示

[英]Autohotkey save excel file without seeing overwrite prompt

我有一個自動熱鍵腳本,可將文件保存到sharepoint中的備份位置。 我可以將文件保存在那里,但是它一直要求可以覆蓋提示,所以我想知道是否有可能消除它。

代碼在下面列出。

ExcelRefresh(File) { ; Function

sharepointPath := "\\sharepoint\Location\SharepointCompleted.xlsx"
oExcel := ComObjCreate("Excel.Application")
oExcel.Visible := false
oWorkbook := oExcel.Workbooks.Open(File) 
oWorkbook.RefreshAll
oWorkbook.Save()
oExcel.ActiveWorkbook.SaveAs(sharepointPath)
oWorkbook.Close(false)
oExcel.Quit()
}

我最終要做的只是簡單檢查文件是否存在,然后從那里檢查是否存在,然后刪除文件,然后再將其保存到SharePoint中的備份位置。 不是清潔方式,但是可以。

IfExist , \\sharepoint\sites\SharepointCompleted.xlsx
;MsgBox, it esxists
FileDelete, \\sharepoint\sites\SharepointCompleted.xlsx

Sleep 15000

我在運行函數之前添加了此代碼。 到目前為止,它已經通過了我的測試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM