trebla
08-22-2008, 01:51 AM
Hello,
Could some one help me with a problem related to print preview in Excel. I have a macro that ends with the following line:
ActiveWindow.SelectedSheets.PrintPreview
I run this macro from another macro in a separate file like this:
Application.SendKeys "{ESC}"
Application.Run (GA_filename(i) & "!run_specific")
By using sendkeys I try to exit the print preview mode and continue executing the macro. Sometimes this works but most of the time the macro pauses in print preview mode and continues only when I click "Close".
I have no idea why the sendkeys statement works occasionally but not always. Any ideas? Unfortunately, I'm unable to edit the original macro which leads to print preview mode. I have tried to put the sendkeys statement after the running of run_specific macro but it doesn't work that way either. Is there a way to exit print preview mode without using sendkeys statement?
Could some one help me with a problem related to print preview in Excel. I have a macro that ends with the following line:
ActiveWindow.SelectedSheets.PrintPreview
I run this macro from another macro in a separate file like this:
Application.SendKeys "{ESC}"
Application.Run (GA_filename(i) & "!run_specific")
By using sendkeys I try to exit the print preview mode and continue executing the macro. Sometimes this works but most of the time the macro pauses in print preview mode and continues only when I click "Close".
I have no idea why the sendkeys statement works occasionally but not always. Any ideas? Unfortunately, I'm unable to edit the original macro which leads to print preview mode. I have tried to put the sendkeys statement after the running of run_specific macro but it doesn't work that way either. Is there a way to exit print preview mode without using sendkeys statement?