How do I deactivivate a workbook?
Hello all,
I can't figure out how to deactivate or minimize a workbook. Without getting too specific, basically I am intercepting the 'close' command until I exit the program and just want to deactivate the workbook the user was trying to close. I can't find any commands that will accomplish this. The workbook has an activate command (wb.Activate) but no deactivate. How can I do this? Thanks ahead of time, Marc |
How do I deactivivate a workbook?
Select another workbook.
One workbook needs to be "activated" -- Regards, Tom Ogilvy Marc wrote in message om... Hello all, I can't figure out how to deactivate or minimize a workbook. Without getting too specific, basically I am intercepting the 'close' command until I exit the program and just want to deactivate the workbook the user was trying to close. I can't find any commands that will accomplish this. The workbook has an activate command (wb.Activate) but no deactivate. How can I do this? Thanks ahead of time, Marc |
How do I deactivivate a workbook?
So it forces you to have an active workbook. I didn't know that. I guess
you can always default to the first workbook in the list. But is there any way to simply minimize the workbook? I think that would be the easiest thing to do. And I can't close it because then it severs my connection to the COM server. If there's a way to reconnect to the workbook after it's closed, I'm not aware of it. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
How do I deactivivate a workbook?
Marc,
I ran the macro recorder and got this (with a little tweak to change from Activewindow to the window for Book1). It minimizes Book1 but Book 1 is still the active workbook. Sub Macro1() Windows("Book1").WindowState = xlMinimized End Sub hth, Doug "Marc Nations" wrote in message ... So it forces you to have an active workbook. I didn't know that. I guess you can always default to the first workbook in the list. But is there any way to simply minimize the workbook? I think that would be the easiest thing to do. And I can't close it because then it severs my connection to the COM server. If there's a way to reconnect to the workbook after it's closed, I'm not aware of it. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
How do I deactivivate a workbook?
Yes, the xlMinimized was what I was looking for.
I'm not a VB guy, and I'm trying to integrate COM with Python, so it's a little difficult sometimes to find the magic command. As a result, I wasn't aware of the VB record function either, and that's mighty helpful also. Many thanks, Marc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
All times are GMT +1. The time now is 05:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com