Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I am having trouble making Excel activate the previous workbook. We have a program which automatically creates spreadsheets in Excel (With random names) so I cannot just do a workbook("Book1.xls").activate code. I am looking for a way to say "Go back to the last workbook you were in". Is this possible?? Thanks John C -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=540647 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the process is controlled by code you could do something like this:
In header: Public LastBookUsed as Workbook In your sub: Set LastBookUsed = Workbooks.Add .... LastBookUsed.Activate But this would only work in certain situations where your code is in control; if the user freely switches workbooks you need to trap that as an event in order to keep track of which book was last used. The Excel Application has a WorkbookActivate event but I think you would need to create a class With Events in order to trap the event and create an event procedure that would keep track of the last workbook the user was in. -- - K Dales "johncassell" wrote: Hello, I am having trouble making Excel activate the previous workbook. We have a program which automatically creates spreadsheets in Excel (With random names) so I cannot just do a workbook("Book1.xls").activate code. I am looking for a way to say "Go back to the last workbook you were in". Is this possible?? Thanks John C -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=540647 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
autorun upon activating a sheet | Excel Programming | |||
autorun upon activating a sheet | Excel Programming | |||
Error 40036 when activating a sheet | Excel Programming | |||
Problem activating a sheet | Excel Programming | |||
Problem in activating a sheet | Excel Programming |