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

Hello-

I wrote code that works with several open workbooks. I
specify particular workbooks using the Workbooks
collection and the name of the workbook, e.g., Workbooks
("Name"). There are a few machines, however, that require
the ".xls" extension, e.g., Workbooks("Name.xls"). Can I
do something, like reference a particular library, to make
sure that one of the methods is going to work? Thanks.

-Paul Larick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Workbook Collection

Why not try both names, with error handling wrapped around it, to test
neither existing?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Larick" wrote in message
...
Hello-

I wrote code that works with several open workbooks. I
specify particular workbooks using the Workbooks
collection and the name of the workbook, e.g., Workbooks
("Name"). There are a few machines, however, that require
the ".xls" extension, e.g., Workbooks("Name.xls"). Can I
do something, like reference a particular library, to make
sure that one of the methods is going to work? Thanks.

-Paul Larick



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Workbook Collection

It is based on a Windows setting. Always use the .xls extension
to be safe. It will always work.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Paul Larick" wrote in message
...
Hello-

I wrote code that works with several open workbooks. I
specify particular workbooks using the Workbooks
collection and the name of the workbook, e.g., Workbooks
("Name"). There are a few machines, however, that require
the ".xls" extension, e.g., Workbooks("Name.xls"). Can I
do something, like reference a particular library, to make
sure that one of the methods is going to work? Thanks.

-Paul Larick



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Workbook Collection

Hi Paul

Like Bob, I think the easiest fastest way is to test both. But for the fun
of it, see if it has to do with "hide extensions for known file types" in
Explorer. That would be wether registry key
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Advance
d\HideFileExt
is 0 (false) or 1(true).

HTH. Best wishes Harald

"Paul Larick" skrev i melding
...
Hello-

I wrote code that works with several open workbooks. I
specify particular workbooks using the Workbooks
collection and the name of the workbook, e.g., Workbooks
("Name"). There are a few machines, however, that require
the ".xls" extension, e.g., Workbooks("Name.xls"). Can I
do something, like reference a particular library, to make
sure that one of the methods is going to work? Thanks.

-Paul Larick



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Workbook Collection

"Chip Pearson" skrev i melding
...
(..) Always use the .xls extension
to be safe. It will always work.


It's that simple ? Thanks Chip.
Best wishes Harald


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
Copy a collection into a new workbook. schaapiee Excel Discussion (Misc queries) 1 February 9th 07 08:30 PM
Retrieving the Collection of Ranges in a Workbook K Dales[_2_] Excel Programming 0 January 19th 05 09:16 PM
Retrieving the Collection of Ranges in a Workbook K Dales[_2_] Excel Programming 0 January 19th 05 09:16 PM
Collection Todd Huttenstine Excel Programming 4 December 17th 04 09:41 PM
How to find the type of Sheet in Excel.Workbook.sheets collection Raj[_7_] Excel Programming 3 December 9th 03 10:48 PM


All times are GMT +1. The time now is 05:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"