Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh pivot table in workbook A when changing a cell in workbook gildengorin Excel Worksheet Functions 2 March 17th 09 04:59 PM
Excel-how to link source workbook to copy of destination workbook D Lynn Excel Worksheet Functions 1 May 29th 08 05:36 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"