![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 10
|
I've set up a billingsheet.xlt with embedded macros. The staff is to copy the xlt over to a xls and edit it. I am addressing the macro as "Application.Run "'DPPriceSheet1.xlt'!POST_TO_WIP", etc. - But need to change it to read something like "'thisworkbook'!POST_TO_WIP" and can't find the command. Keep in mind that the workbook could, conceivably, be called anything, so I can't force a name in.
Thanks in advance. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
'include the line
thisworkbook= activeworkbook.name 'this line will define the name of the current workbook being used in excel. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 10
|
Thanks. It almost worked, but I think that the single quotes around the filename is leading it to return a runtime error 438
"Object doesn't support this property or method". Any other ideas?? Thanks |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
you are right, now that we have defined the name of the workbook as "this workbook" we no longer need the apostrophies. so try this.
thisworkbook=activeworkbook.name Application.Run "thisworkbook!POST_TO_WIP |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|