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

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Excel VB, Workbook.activate

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VB, Workbook.activate


-----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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Excel VB, Workbook.activate

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel VB, Workbook.activate

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Excel VB, Workbook.activate

"sclark" wrote in message
...
I learn somethin new everyday with this stuff.


Hey, me too! :-)


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel VB, Workbook.activate

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel VB, Workbook.activate

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel VB, Workbook.activate

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
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
Activate Workbook Dolphinv4 Excel Discussion (Misc queries) 2 October 22nd 05 01:45 PM
Workbook.activate Jeff Excel Discussion (Misc queries) 1 December 13th 04 10:22 PM
Activate Workbook in Separate Excel Session Bob Ewers Excel Programming 2 February 11th 04 11:46 PM
Activate Workbook Fred[_16_] Excel Programming 1 December 2nd 03 05:15 PM
excel 2000 workbook.activate not 100% reliable with alt+tab Gavin Frayne Excel Programming 9 July 24th 03 09:29 AM


All times are GMT +1. The time now is 09:40 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"