PDA

View Full Version : Automatic open, save, close problem.



atermeer
09-04-2007, 02:29 AM
I will try this question again. I have a workbook and a few needs:

I have a workbook that I want to open every day at 8:30 AM.

When it opens, it needs to update from its external data source (this concerns me; as it stands now when you open it you must select the option to allow it to automatically update).

Once updated, I need it to print.

Then I need it to save with filename and yesterday's date (I think I have this part figured out). (No specified path means in same folder as when opened, right?)


Then I need it to close.


That is all I need. Some background:

The computer is a network computer which is on 24-7. I have understood to open a workbook using scheduler, but I can only see how to open Excel, not a specific workbook. I appreciate any and all help...

Belch
09-04-2007, 02:59 AM
Hi ater,
I can't help with updating the external source (not off the top of my head anyway), but with the scheduler you should be able to browse to a specific workbook rather than just Excel on it's own.

You probably want to put the external source update code in the Workbook_Open routine in ThisWorkbook, and use Me.PrintOut to print to the default printer (but there are parameters to change that).

Hope that helps.

atermeer
09-04-2007, 03:18 AM
Neil -

Thank you very much. I initially tried to browse to the workbook, but at the scheduled time I got a message saying that there was no program associated... it suggested folder options but I honestly could not see how to associate.

The auto update is through MS Query, not sure how to copy the code. Cannot just display SQL in MS Query and then copy it.

In all honesty I have used a long painful process of learning from an existing workbook that I received, already accessing the database. I have explored tables therein and created some stuff but am far from being good at this. I am literally trying to figure out the code for all the above-listed steps. Thanks again for your reply...

lucas
09-04-2007, 07:43 AM
Thank you very much. I initially tried to browse to the workbook, but at the scheduled time I got a message saying that there was no program associated
What happens if you browse to the file on the network using explorer and double click on the excel file. If it asks you to associate a program with it before opening that should solve that problem.