Workbook Collection

  • Thread starter Thread starter Paul Larick
  • Start date Start date
P

Paul Larick

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
 
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)
 
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
 
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\CurrentVersion\Explorer\Advance
d\HideFileExt
is 0 (false) or 1(true).

HTH. Best wishes Harald
 
Chip Pearson said:
(..) Always use the .xls extension
to be safe. It will always work.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top