Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extension-problem in Excel.

Status
Not open for further replies.

lode

Programmer
Nov 8, 2001
208
BE
Suppose you have this code somewhere :

Workbooks("Weeg42").Worksheets("Weeg42").Activate

You know you can hide the extensions in your Windows Explorer.
If you unhide the extensions in Windows Explorer the code won't work anymore.

Is this a usefull tip or am I ..........


 
I've never heard of it. I think, perhaps, there's some other reason it's not working, if that's whay you're saying. That means, then, that our code would rarely work for our clients because many of them don't show extensions while we certainly do. And that's not the case. I don't do enough code to know 100% for certain, but I'm sure I've had the scenario, and the code worked anyway. Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
Hello, Iode.

As you raise this issue as a tip, it should at least present the minimum scope of it in order not to confuse the matter.

[1] The name of the worksheet "weeg42" has nothing to do with the problem. So it is not a magic correlation between the name of the worksheet and the workbook.

[2] The View Options---hide or unhide the known extensions---do not interfere with the Open the workbook from the file weeg42.xls. That means:

[2.a] Workbooks.Open &quot;<path>\weeg42.xls&quot;
or
[2.b] Workbooks.Open &quot;<path>\weeg42&quot;

both work properly under any View Options on the known extensions.

[3] Suppose this workbook is the ActiveWorkbook, then
ActiveWorkbook.Name ==> &quot;weeg42.xls&quot;
with the extension shown under both View Options on extensions as well as the way you open the workbook [2.a] or [2.b].

[4] Now if you call up the workbook among others already opened, you can always use the name as shown in [3], which is logic, ie,
Workbooks(&quot;weeg42.xls&quot;)
always works properly no matter how you open the workbook with [2.a] or [2.b].

[5] However, if you want to use alias of hiding known extension in calling up the workbooks(&quot;weeg42.xls&quot;) by
Workbooks(&quot;weeg42&quot;) _limited applicability_
then, it is accepted only under the View Option of hiding known extensions, but not otherwise, ie View Option unhide known extensions.

Hope that clear up the matter.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top