Hey,
Can someone help me figure out how to make this code loop so that it saves my worksheet every 24 hours:
Private Sub Workbook_Open()
'This will run the code 1 minute after the worksheet is opened
Application.OnT ime Now + TimeValue("24:0 0:00"), "SaveData", , True
End Sub
Onthefly
User Profile
Collapse
-
Quick question, will this loop the time so it saves it every day at the same time without me having to re-open this?
I'm glad you learned as well. The cool thing about this set up is that I now have about 25 excel reports that automatically update themselves every day/week/month and e-mail themselves to the business owners at a specified time, so I don't have to touch them. -
-
Hey, I think this will work! But I must be missing something because as it tries to save I get this error:
The Macro:"C:Docume nts and Settings\....'! SaveData' cannot be found.
Sorry, I am fairly new with VB so I am probably missing something simple.. any idea?Leave a comment:
-
Actually I have it the other way around. I have an excel spreadsheet that is pulling info from my MS SQL database everynight and posting the results in the spreadsheet (and it erases the results that were their the day before). So my question is, how do I then save the changes from the new query after the update took place so I can e-mail out the new figures.
Thanks for your help by the way....Leave a comment:
-
That is what I originally tried, and it works but the autosave feature saves it as an .xar file and it saves it like a hidden file which prevents my re-occurring e-mail software program from recognizing it. Using the Autosave feature would be my first choice if I could figure out a way around this issue.Leave a comment:
-
Run SQL Query, then Save
I am trying to automate an excel report so that it automatically posts a SQL query then saves the file every 24 hours. Currently I can do one or the other (post sql or save) but I cannot run both at the same time.
So far, I have an ODBC connection between my excel file and my MS SQL database and have the SQL queries refreshing every 1440 minutes.
I also have a VB timer set to run every 24 hours to save the workbook...
No activity results to display
Show More
Leave a comment: