Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Referencing an External Sheet without Knowing its Name - XL2K

Hello World,

Is it possible, either through VBA or a formula, to check the value of
cell in a closed workbook if you don't know the sheet name?

All I know is that it will always be the first and probably only sheet
in the Workbook.

Kind regards,
Nick.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing an External Sheet without Knowing its Name - XL2K

why not open the workbook and retrieve the value, then close the workbook

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Hello World,

Is it possible, either through VBA or a formula, to check the value of
cell in a closed workbook if you don't know the sheet name?

All I know is that it will always be the first and probably only sheet
in the Workbook.

Kind regards,
Nick.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Referencing an External Sheet without Knowing its Name - XL2K

Tom Ogilvy wrote:
why not open the workbook and retrieve the value, then close the workbook


Hi Tom,

Thanks for taking the time to respond.

The reason is that the user will have a large number of workbooks to
process and although the ones we are interested are fairly small they
may be sitting in the same directory as many other heavy-weight
workbooks (15-20 Mb) which will take a while to load.

My boss is reluctant to try and force the users to keep these workbooks
in separate directories or adhere to specific naming conventions (my
first suggestions) but wants them to be able to simply point to the
directory that contains the files.

My desire to not open all the files is simply to speed up the checking
of which files should be processed.

Kind regards,
Nick

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Referencing an External Sheet without Knowing its Name - XL2K

You can use ADO if you want
http://www.rondebruin.nl/ado.htm

But open it is also a good option

--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message oups.com...
Hello World,

Is it possible, either through VBA or a formula, to check the value of
cell in a closed workbook if you don't know the sheet name?

All I know is that it will always be the first and probably only sheet
in the Workbook.

Kind regards,
Nick.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Referencing an External Sheet without Knowing its Name - XL2K

Many thanks Ron, I'll give this a go and let you know how I get on (may
not be for a couple of days as I'm fire-fighting another project at the
mo').

Kind regards,
Nick.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Referencing an External Sheet without Knowing its Name - XL2K

Update...

Hi Ron,

I found a few minutes to follow your link and try out the code therein.
Unfortunately it seems ADO still requires you to specify a string for
the sheet name. I tried changing the datatype of SourceSheet to integer
and then passing it a 1 to specify the first sheet but this failed to
work.

I strongly suspect this simply isn't possible but I will be grateful
for any other suggestions.

Regards,
Nick.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing an External Sheet without Knowing its Name - XL2K

from your response to me, it sounds like you don't even know which workbooks
to process besides not knowing the sheet name.

Do you determine if a book should be processed by retrieving some
information from it?

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Update...

Hi Ron,

I found a few minutes to follow your link and try out the code therein.
Unfortunately it seems ADO still requires you to specify a string for
the sheet name. I tried changing the datatype of SourceSheet to integer
and then passing it a 1 to specify the first sheet but this failed to
work.

I strongly suspect this simply isn't possible but I will be grateful
for any other suggestions.

Regards,
Nick.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Referencing an External Sheet without Knowing its Name - XL2K

Yes Tom, That's the gist of it. :)

Regards,
Nick.

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
Knowing the creation date of an excel sheet email attachment Alice Excel Discussion (Misc queries) 3 September 23rd 08 05:37 PM
Referencing External Data Smiley[_2_] Excel Discussion (Misc queries) 1 August 18th 08 07:21 PM
Indirect referencing of external spreadsheets GSM Excel Discussion (Misc queries) 4 February 16th 08 01:59 PM
Need an EXPERT in VBA and knowing how to manipulate objects on an excel sheet holysoul Excel Programming 2 May 11th 04 01:20 PM
referencing external workbook using variables keepitcool Excel Programming 0 September 29th 03 06:26 PM


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