Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default current workbook name

Hi,
I have a Master workbook called "MESSER" to be used over and over by new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever that
is?
thanks
Helmut

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default current workbook name


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

€˛Helmut€¯ ezt Ć*rta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever that
is?
thanks
Helmut

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default current workbook name

Hi Stefi,
I get a Run-time-Error 1004.... actual workbook name!Sort_by_ID cannot be
found.
any other suggestions?
Helmut

"Stefi" wrote:


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

€˛Helmut€¯ ezt Ć*rta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever that
is?
thanks
Helmut

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default current workbook name

Hi Stefi,
It works in the original workbook, but after a NEW workbook was created with
another name, int that new workbook it gives me the RunTimeError.
Helmut

"Stefi" wrote:


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

€˛Helmut€¯ ezt Ć*rta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever that
is?
thanks
Helmut

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default current workbook name

Try

Application.Run "'" & Activeworkbook.Name & "'!Sort_by_ID"


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Helmut" wrote in message
...
Hi Stefi,
I get a Run-time-Error 1004.... actual workbook name!Sort_by_ID cannot be
found.
any other suggestions?
Helmut

"Stefi" wrote:


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

"Helmut" ezt ķrta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by

new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever

that
is?
thanks
Helmut





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default current workbook name

How is a new workbook created? By copying the original MESSER.XLS to a new
name or MESSER.XLS is opened and saved as another workbook e.g. in
Workbook_open event or ... ? Can you stop the macro at line
Application.Run Thisworkbook.Name & "!Sort_by_ID"
and debug Thisworkbook.Name?
Stefi


€˛Helmut€¯ ezt Ć*rta:

Hi Stefi,
It works in the original workbook, but after a NEW workbook was created with
another name, int that new workbook it gives me the RunTimeError.
Helmut

"Stefi" wrote:


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

€˛Helmut€¯ ezt Ć*rta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever that
is?
thanks
Helmut

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default current workbook name

Thanks Bob, the "'" did the trick...
Helmut

"Bob Phillips" wrote:

Try

Application.Run "'" & Activeworkbook.Name & "'!Sort_by_ID"


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Helmut" wrote in message
...
Hi Stefi,
I get a Run-time-Error 1004.... actual workbook name!Sort_by_ID cannot be
found.
any other suggestions?
Helmut

"Stefi" wrote:


Try Application.Run Thisworkbook.Name & "!Sort_by_ID"

Regards,
Stefi

"Helmut" ezt Ć*rta:

Hi,
I have a Master workbook called "MESSER" to be used over and over by

new
people.
Upon first use, the name of the workbook is changed to whatever name.

The following statement:

Application.Run "MESSER.xls!Sort_by_ID"

obiously doesn't work in the new workbook with a different name.
Is there anyway to have "MESSER.xls" replaced by an expression which
reflects the new workbook name i.e. the 'currentworkbookname' whatever

that
is?
thanks
Helmut




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
Treeview For Current Workbook? JD via OfficeKB.com Excel Programming 2 February 3rd 06 07:50 PM
Place code from current workbook to new workbook Qaspec Excel Programming 5 June 8th 05 04:12 AM
Close a the current workbook and load another specified workbook Adrian[_7_] Excel Programming 4 August 7th 04 05:29 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
Transparently updating another workbook from the current workbook lothario[_40_] Excel Programming 3 November 2nd 03 01:58 AM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"