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

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default To open workbooks: how to put behind wbk in front?

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default To open workbooks: how to put behind wbk in front?

Fred, it is always better to refer the workbook when you open..

Dim wbBook1 As Workbook
Dim wbBook2 As Workbook

Set wbBook1 = Workbooks.Open("<fullpath\<filename.ext")
Set wbBook2 = Workbooks.Open("<fullpath\<filename.ext")

wbBook1.Activate

If this post helps click Yes
---------------
Jacob Skaria


"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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default To open workbooks: how to put behind wbk in front?

I do this:

Dim wbFirstName as string

' do stuff that opens the first workbook

wbFirstName = Activeworkbook.name

' your code here that opens second workbook

Workbooks(wbFirstName).activate


"Jacob Skaria" wrote:

Fred, it is always better to refer the workbook when you open..

Dim wbBook1 As Workbook
Dim wbBook2 As Workbook

Set wbBook1 = Workbooks.Open("<fullpath\<filename.ext")
Set wbBook2 = Workbooks.Open("<fullpath\<filename.ext")

wbBook1.Activate

If this post helps click Yes
---------------
Jacob Skaria


"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



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
To open workbooks: how to put behind wbk in front? Dave Peterson Excel Programming 0 June 15th 09 02:44 AM
To open workbooks: how to put behind wbk in front? Dave Peterson Excel Programming 0 June 15th 09 02:30 AM
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


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