2011-04-28 74 views
1

嗨我想在網上獲得一個n excel文件來使用AutoIT自動保存。AutoIT測試幫助

下面的代碼是不工作:

#include <IE.au3> 
$oIE = _IECreate ("http://127.0.0.1/my_site") 
_IENavigate ($oIE, "http://databases.about.com/library/samples/address.xls") 

WinWait("File Download","Do you want to open or save this file?") 
ControlClick("File Download","Do you want to open or save this file","Button2") 
WinWait("Save As","Save &in:") 
+2

什麼不行?有錯誤嗎?你能否分享一些更多的細節。 – JohnD 2011-04-28 21:37:44

回答

1

嘗試它使用IE是不正確的方式做。

您是否嘗試過使用InetGet函數?

Local $sFileName = FileSaveDialog("Save excel file...", @MyDocumentsDir, "Excel spreadsheet (*.xls)|All Files (*.*)", 18, "address.xls") 
If @error Then Exit ; User cancelled the dialog 

Local $iBytes = InetGet("http://databases.about.com/library/samples/address.xls", $sFileName, 8) 
MsgBox(0, "Worked :)", "File downloaded. " & $iBytes & " downloaded.") 

這工作,我得到一個下載的電子表格與地址(聽起來正確)。

墊子