I have an application that opens excel and uses excel in the back ground. The application also has a way to execute excel macros. The excel macro I have written checks some conditions and then sends a message via a msgbox to the screen. My problem is that since the excel is not in focus when I execute the macro, the macro waits until the excel is in focus, displays the msg, and when I exit excel status in focus.
I would like to see excel remain in the background ad the message displayed and when the msgbox is closed and the macro ends, excel stays minimized the entire time.
I will accept that excel is shown when teh macro executes, and is minimized when the msgbox is closed (focus reverting back to my main applicaiton).
I have tried many different approaches. Removing the un-needed code, I have the following in my macro:
sub msgmacro
...
msgbox ("Message")
...
AppActivate "Microsoft Excel"
Applicaiton.Win dowState = xlMinimized
...
end sub
I have also tried adding logic at the end of the macro
AppActivate "mymainapp"
Applicaiton.Dis playFullScreen = True
Applicaiton.Int eractive = True
Applicaiton.Win dowState = xlNormal
And the following at the beginning of the macro
AppActivate "MicroSoft Excel"
Application.Win dowState = xlNormal
all wihtout success.
I would like to see excel remain in the background ad the message displayed and when the msgbox is closed and the macro ends, excel stays minimized the entire time.
I will accept that excel is shown when teh macro executes, and is minimized when the msgbox is closed (focus reverting back to my main applicaiton).
I have tried many different approaches. Removing the un-needed code, I have the following in my macro:
sub msgmacro
...
msgbox ("Message")
...
AppActivate "Microsoft Excel"
Applicaiton.Win dowState = xlMinimized
...
end sub
I have also tried adding logic at the end of the macro
AppActivate "mymainapp"
Applicaiton.Dis playFullScreen = True
Applicaiton.Int eractive = True
Applicaiton.Win dowState = xlNormal
And the following at the beginning of the macro
AppActivate "MicroSoft Excel"
Application.Win dowState = xlNormal
all wihtout success.
Comment