Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I ran into a problem the other day with Activating an Open
workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I believe it is the Windows setting that controls the behavior. In a Windows
Exlporer window: Tools | Folder Options | View | Hide file extensions for known file types -- Vasant "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -----Original Message----- I believe it is the Windows setting that controls the behavior. In a Windows Exlporer window: Tools | Folder Options | View | Hide file extensions for known file types -- Vasant "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? . Thanks for the reply. I tried that and it didn't work. Not sure if I have to reboot or not (I havent) but it still fails. Funny thing is that it will OPEN workbooks without being fully qualified, but it won't activate them. My other computer does both...I'm certain there must be a setting somewhere, and the one you suggested seemed like a likely candidate. I will keep searching. Steve |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BTW, it waould be a lot easier to use:
ThisWorkbook.Activate to activate the workbook containing the macro. -- Vasant "slcark" wrote in message ... -----Original Message----- I believe it is the Windows setting that controls the behavior. In a Windows Exlporer window: Tools | Folder Options | View | Hide file extensions for known file types -- Vasant "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? . Thanks for the reply. I tried that and it didn't work. Not sure if I have to reboot or not (I havent) but it still fails. Funny thing is that it will OPEN workbooks without being fully qualified, but it won't activate them. My other computer does both...I'm certain there must be a setting somewhere, and the one you suggested seemed like a likely candidate. I will keep searching. Steve |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, I learn somethin new everyday with this stuff.
Never knew about the 'ThisWorkBook' b4. -----Original Message----- BTW, it waould be a lot easier to use: ThisWorkbook.Activate to activate the workbook containing the macro. -- Vasant "slcark" wrote in message ... -----Original Message----- I believe it is the Windows setting that controls the behavior. In a Windows Exlporer window: Tools | Folder Options | View | Hide file extensions for known file types -- Vasant "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? . Thanks for the reply. I tried that and it didn't work. Not sure if I have to reboot or not (I havent) but it still fails. Funny thing is that it will OPEN workbooks without being fully qualified, but it won't activate them. My other computer does both...I'm certain there must be a setting somewhere, and the one you suggested seemed like a likely candidate. I will keep searching. Steve . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"sclark" wrote in message
... I learn somethin new everyday with this stuff. Hey, me too! :-) |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Without the full path, excel defaults to its own root directory.
-- Patrick Molloy Microsoft Excel MVP ---------------------------------- "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What's weird about this, is the macro I'm having a problem
with opens starts with ONE workbook open (the one with the macro in it), and it opens another which is in a completely different path (root of C:). On MY pc at work, it handles BOTH of these just fine without fully qualifying the name. All other pc's I've tried it on won't work. Another thing is that the OPEN works fine without full qualification (obviously the path is qualified, just not the extension) but the Activate is where I have the problem. It is EASY to 'fix' (just add the .xls or .wk3) to the book name on the Activate command, but I just like to understand WHY that needs to be done on one computer but not others. Here is the code: Application.ScreenUpdating = False Workbooks.Open Filename:="C:\All_Sirs_Daily" Workbooks("SIR Status v3.0.xls").Activate All_Sirs_Daily is a .wk3 file (from lotus notes extract) and Sir Status v3.0 is the one with the macro. That Activate will fail if not fully qualified as shown above. Subsequent Activates on All_Sirs_Daily will also fail without full qualification. Steve -----Original Message----- Without the full path, excel defaults to its own root directory. -- Patrick Molloy Microsoft Excel MVP ---------------------------------- "sclark" wrote in message ... I ran into a problem the other day with Activating an Open workbook in Excel VB. I run this macro everyday, and it has no problem on MY pc, but fails on most others. The code is Workbooks("MyBook").Activate, where MyBook is the workbook that contains the macro. It fails on other pc's because the name MyBook is not fully qualified to MyBook.xls. If I fully qualify it, it works on all machines. Is there an XL setting somewhere that controls whether the fully qualified name is required or not? . |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm. I would understand that if it was having trouble finding the actual path of the file. When I say fully qualify, I am not qualifying the path, just the file extension (xls). This one still stumps m
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Activate Workbook | Excel Discussion (Misc queries) | |||
Workbook.activate | Excel Discussion (Misc queries) | |||
Activate Workbook in Separate Excel Session | Excel Programming | |||
Activate Workbook | Excel Programming | |||
excel 2000 workbook.activate not 100% reliable with alt+tab | Excel Programming |