简体   繁体   English

使用另存为对话框保存下载文件的vba代码

[英]vba code to save downloaded file using SaveAs dialog box

How can I download a file, then save it to wherever I want?如何下载文件,然后将其保存到我想要的任何位置? The download part is done but when vba codes makes a click on download button a popup of SaveAs Dialog button gets opened.How to use that SaveAs Dialog box so that my macro continously runs without any pause in between.下载部分已完成,但是当 vba 代码单击下载按钮时,会打开“另存为”对话框按钮的弹出窗口。如何使用该“另存为”对话框,以便我的宏连续运行而不会出现任何停顿。

I concur with Iowak's comment that it's not clear what you're doing as how but as a bit of a shot in the dark, are you saying that you want to incorporate the Save As dialog into the VBA code that does the download rather than doing the save as as a separate action?我同意爱荷华州的评论,即不清楚您在做什么,但作为在黑暗中的一个镜头,您是说要将“另存为”对话框合并到执行下载的 VBA 代码中而不是做将另存为单独的操作?

If so it's likely that all you need to do is incorporate the Application.GetSaveAsFilename method into your download code:如果是这样,您可能需要做的就是将 Application.GetSaveAsFilename 方法合并到您的下载代码中:

fileSaveName = Application.GetSaveAsFilename( _ 
 fileFilter:="Text Files (*.txt), *.txt") 
If fileSaveName <> False Then 
    MsgBox "Save as " & fileSaveName 
End If

If that's not it then as Iowak said you'd really need to post the code.如果不是这样,那么正如爱荷华州所说,您真的需要发布代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM