Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I can't see a Workbook in WorkBooks.Count

I've two workbooks opened, but each one in one different Excel's windows,
how can I work with both by code?

The sentence:

?Workbooks.count

only returns one.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default I can't see a Workbook in WorkBooks.Count

Jordi,

If Workbooks.Count returns 1, then you have only 1 workbook open, with
mutliple windows of that one workbook. Try using

Debug.Print ActiveWorkbook.Windows.Count

to confirm.

Then you really aren't working with different workbooks - just
different views of the same workbook.

HTH,
Bernie
MS Excel MVP

"Jordi" wrote in message
...
I've two workbooks opened, but each one in one different Excel's

windows,
how can I work with both by code?

The sentence:

?Workbooks.count

only returns one.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I can't see a Workbook in WorkBooks.Count

Thank you for your attention, but isn't the case.
I open one workbook, and then another aplications creates a new workbook, in
the Window menu I only see the current window in each Excel, but I have two
workbooks opened in two Excel.

I'm using Excel 2002.

"Bernie Deitrick" escribió en el mensaje
...
Jordi,

If Workbooks.Count returns 1, then you have only 1 workbook open, with
mutliple windows of that one workbook. Try using

Debug.Print ActiveWorkbook.Windows.Count

to confirm.

Then you really aren't working with different workbooks - just
different views of the same workbook.

HTH,
Bernie
MS Excel MVP

"Jordi" wrote in message
...
I've two workbooks opened, but each one in one different Excel's

windows,
how can I work with both by code?

The sentence:

?Workbooks.count

only returns one.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default I can't see a Workbook in WorkBooks.Count

Jordi,

Why are you using two instances rather than a single instance?

In your other application, you can find the current active Excel by
using GetObject:

Public xlApp As Excel.Application
On Error Resume Next
Set xlApp = GetObject("Excel.Application")
If xlApp = Nothing Then
Set xlApp = CreateObject("Excel.Application")
End If

You will need to have a reference set to the Excel object library in
your other application.

Then, you should be able to find all open workbooks, since you will
only have one Excel.

HTH,
Bernie
MS Excel MVP

"Jordi" wrote in message
...
Thank you for your attention, but isn't the case.
I open one workbook, and then another aplications creates a new

workbook, in
the Window menu I only see the current window in each Excel, but I

have two
workbooks opened in two Excel.

I'm using Excel 2002.




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
want to copy many workbooks into 1 workbook april Excel Discussion (Misc queries) 1 August 13th 08 08:01 PM
how do I divide a workbook into two workbooks? kitsie Excel Discussion (Misc queries) 2 May 18th 07 10:11 PM
Convert 2 workbooks into 1 workbook jeridbohmann Excel Discussion (Misc queries) 1 January 5th 06 02:15 AM
I'm trying to merge 2 workbooks into 1 new workbook. Barb Excel Discussion (Misc queries) 0 September 23rd 05 02:42 PM
Count of workbooks in a directory David Excel Programming 1 November 11th 03 10:20 PM


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