Windows Name Now Has Changed ?

sbmaurer

New Member
Joined
Dec 12, 2011
Messages
25
Hello and happy Friday to everyone,

This may be a very simple question.

Somehow the name of my excel windows have changed to including a ".xlsm" at the end.

Specifically I used to be able to reference a window by writing

Code:
Windows("BIA Master Drop Down List").Activate

Now I need to reference by writing

Code:
Windows("BIA Master Drop Down List.xlsm").Activate

Can anyone shed some light as to how this changed, is there some setting that I turned on or off? I would like to know because on another users machine the code will not work because of this mis-naming.

Cheers!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
Hello and happy Friday to everyone,

This may be a very simple question.

Somehow the name of my excel windows have changed to including a ".xlsm" at the end.

Specifically I used to be able to reference a window by writing

Code:
Windows("BIA Master Drop Down List").Activate

Now I need to reference by writing

Code:
Windows("BIA Master Drop Down List.xlsm").Activate

Can anyone shed some light as to how this changed, is there some setting that I turned on or off? I would like to know because on another users machine the code will not work because of this mis-naming.

Cheers!

It is probably in your Windows application settings(Control Palnel), where you can opt to show file extensions or not. If you opt to show the file extension, then you must use it in your code because it is part of the file name.
And it will apply to all applications, Word, power point, Outlook, etc.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,786
Office Version
  1. 2010
Platform
  1. Windows
The latter syntax will always work, so it is greatly preferable.
 

Gary's Student

Well-known Member
Joined
Aug 4, 2012
Messages
1,015
Good answer...............additionally you can always tell which form to use by examining the Caption:

Code:
Sub marine()
MsgBox Application.ActiveWindow.Caption
End Sub
 

sbmaurer

New Member
Joined
Dec 12, 2011
Messages
25
Hello,

Thanks everyone this certainly solves the problem. Two key things to mention.

1) Went to the control pannel and restored default settings and that did change the name of the window
2) Used the latter syntax above with the ".xlsm" extension and the code works on all types of window naming conventions


Thanks for the help,

Cheers!
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,786
Office Version
  1. 2010
Platform
  1. Windows
You're welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,119
Messages
5,640,219
Members
417,131
Latest member
Seanr19871

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top