I’ve got a nice question. When I press on a button it opens me Excel document, which has to refresh it’s data (it gets external data out of the database). What I want is to print the Excel document. Inside the document I created Autpen macro, which runs automatically when I open the document, but the bloody thing start to print the document first and than refreshes it. How can I pause printing, so the document refreshes first.
I’ve got a nice question. When I press on a button it opens me Excel document, which has to refresh it’s data (it gets external data out of the database). What I want is to print the Excel document. Inside the document I created Autpen macro, which runs automatically when I open the document, but the bloody thing start to print the document first and than refreshes it. How can I pause printing, so the document refreshes first.
Why dont you do this event handling in excel? Its more logically and realistically correct.
Open the excel document and there is a startup event or open event for that excel file. In there tell excel to refresh the data and then print the document. The easy way is to record a macro doing this and taking that code and placing it in the correct event.