Macro broken with workbook name change


A

Annabelle

I've created a macro that allows the end user to roll-up individual
worksheets into a Master worksheet within the same workbook, executing
three other macros. This works great until the file name is changed
(reflecting the date of last change), then the receive the error below.
The working file name is Project Tracking Report - 060127.xls and all
of the macros are contained within this workbook becauses the three end
users access from a shared directory.

ASSISTANCE REQUEST
This problem occurs when the file name is changed. Is there a way to
update the code so it reflects the current workbook name?

ERROR:
Run-time error '1004':
Select method of Range class failed


MACRO
Sub MasterPTR2()
'
' MasterPTR2 Macro
' Macro recorded 1/30/2006 by B. Ann Bolland
'

'
Rows("5:800").Select
Selection.ClearContents
Range("A5").Select
Application.Run "'Project Tracking Report - 060127.xls'!Test4"
Application.Run "'Project Tracking Report -
060127.xls'!Master_Cleanup"
Application.CutCopyMode = False
Application.Run "'Project Tracking Report -
060127.xls'!Master_Cleanup2"
End Sub
 
Ad

Advertisements

D

Dave Peterson

This is just one single workbook?

If yes, then just call your other procedures:

Call Test4
(instead of application.run....)
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top