Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unopened workbook values

Is it possible to know the name of a sheet in a workbook without opening the
file?

Or is it possible to get values from a closed workbook - using the
ExecuteExcel4Macro command, for instance - and not knowing the name of the
sheets? - This function requires, as long as I know, that you use the names
of the sheets, and not their numbers.

Thanks

Sam



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unopened workbook values

That's true.

However there are serious resons why I don't want the workbooks to be
opened. (My macro is analysing the workbook to check if it can import data
and I don't want any other macro to start on open.)


"Ron de Bruin" a écrit dans le message de
...
Hi

I think you are right that you can't use the index.

But opening a worknook is in most cases faster.
And you have more control.



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Amuel Pouart" wrote in message

...
Is it possible to know the name of a sheet in a workbook without opening

the
file?

Or is it possible to get values from a closed workbook - using the
ExecuteExcel4Macro command, for instance - and not knowing the name of

the
sheets? - This function requires, as long as I know, that you use the

names
of the sheets, and not their numbers.

Thanks

Sam







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Unopened workbook values

If you open a workbook you can use this to stop code to run.

Dim wb As Workbook
Application.EnableEvents = False
Set wb = Workbooks.Open("C:\Data\book1.xls")
' do your things
wb.Close
Application.EnableEvents = True


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Amuel Pouart" wrote in message ...
That's true.

However there are serious resons why I don't want the workbooks to be
opened. (My macro is analysing the workbook to check if it can import data
and I don't want any other macro to start on open.)


"Ron de Bruin" a écrit dans le message de
...
Hi

I think you are right that you can't use the index.

But opening a worknook is in most cases faster.
And you have more control.



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Amuel Pouart" wrote in message

...
Is it possible to know the name of a sheet in a workbook without opening

the
file?

Or is it possible to get values from a closed workbook - using the
ExecuteExcel4Macro command, for instance - and not knowing the name of

the
sheets? - This function requires, as long as I know, that you use the

names
of the sheets, and not their numbers.

Thanks

Sam









  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unopened workbook values

That's what I call info. Thanks a lot.


Samuel Marin


*** 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
Importing unopened worksheet into an open Workbook GrayesGhost Excel Discussion (Misc queries) 24 July 3rd 08 10:06 PM
hyperlink to an unopened workbook? Karenatallied Excel Discussion (Misc queries) 2 October 17th 06 04:03 PM
Move a spreadsheet to an unopened workbook thegentree Excel Worksheet Functions 0 August 15th 06 11:36 PM
Unopened workbook H. Excel Discussion (Misc queries) 1 May 2nd 06 04:12 PM
Importing Data from unopened Workbook into an open Workbook GrayesGhost Excel Discussion (Misc queries) 0 March 5th 05 11:25 PM


All times are GMT +1. The time now is 01:40 AM.

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"