ryannnn_stl
New Member
- Joined
- Jun 30, 2009
- Messages
- 9
I can't figure this one out and I would appreciate some help.
What I'm trying to do...
I download an excel file from an external website like 5 times a day. I want to have a custom button, in my toolbar, that takes the activeworkbook and saves the file as a specific file name, then closes the file.
Process...
On the website I click, "Download to Excel," and and excel file pops up automatically. (The file name that gets downloaded is always different, depending on the time and date. example: "0805101355.xls") I then have to click file, save as and navigate to a specific file. (THe file that I save to is always the same, "daily_sales.xls") I save as and then close the work book.
^ I want a permanant button, that always opens with excel, that does this automatically
I have a feeling this is an easy fix. I just can't figure out how to do it. I think the problem is I don't know where to put this code. I tried putting the code in the daily_sales.xls file, but it wouldn't close the original Let me know if I need to clarify anything. Thanks for the help! Ryan
What I'm trying to do...
I download an excel file from an external website like 5 times a day. I want to have a custom button, in my toolbar, that takes the activeworkbook and saves the file as a specific file name, then closes the file.
Process...
On the website I click, "Download to Excel," and and excel file pops up automatically. (The file name that gets downloaded is always different, depending on the time and date. example: "0805101355.xls") I then have to click file, save as and navigate to a specific file. (THe file that I save to is always the same, "daily_sales.xls") I save as and then close the work book.
^ I want a permanant button, that always opens with excel, that does this automatically
I have a feeling this is an easy fix. I just can't figure out how to do it. I think the problem is I don't know where to put this code. I tried putting the code in the daily_sales.xls file, but it wouldn't close the original Let me know if I need to clarify anything. Thanks for the help! Ryan
Code:
Sub sales_save()
Application.DisplayAlerts = False
Dim name As String, name1 As String
name = ThisWorkbook.name
name1 = "daily_sales.xls"
Windows(name).Activate
ThisWorkbook.SaveAs Filename:= _
"C:/daily_sales.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows(name1).Activate
ActiveWindow.Close
End Sub