Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default To open workbooks: how to put behind wbk in front?

So you want to just activate the workbook (or window) that was active before
your code started?

Dim ActWkbk as workbook
set actwkbk = nothing
on error resume next
set actwkbk = activeworkbook
on error goto 0

'your code here

if actwkbk is nothing then
'nothing was active when you started
else
actwkbk.activate
end if



fred wrote:

That can be the problem.
If the workbook is already opened before my app starts I will not know its
name.
Thanks,
Fred

"Dave Peterson" wrote in message
...
If you know the name of the workbook being opened:
Workbooks("book999.xls").activate


fred wrote:

Hello,
My app opens 2 workbooks using Excel automation.
The second wrkbook is displayed in front.
How to put the first wrkbook in front?
Thanks,
Fred


--

Dave Peterson


--

Dave Peterson
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
Excel2007; workbooks.count is not counting all open workbooks greg.campeau Excel Programming 2 August 2nd 08 08:37 PM
use hyperlink to open file as front screen Kerry Excel Discussion (Misc queries) 0 October 30th 07 04:28 AM
how do I open a publisher file in front page mike ramsey Excel Worksheet Functions 2 July 13th 06 04:36 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
Open a file with Front Page from Excel Rocky McKinley Excel Programming 0 December 4th 03 12:38 AM


All times are GMT +1. The time now is 03:43 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"