LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default error when running macro from another workbook


With the below code in a workbook I get "Cannot run macro. Macro may not be
available in this workbook or all macros my be disabled." I have checked
that all macros are enabled under the trust center and MonthlyUpdate is not a
private sub and does exist in the second workbook. What am I missing?


Sub UpdateBig()

Dim PathToFile As String
Dim File2Update As Workbook
Dim MyResult As Variant
Dim NameofFile As String

NameofFile = "abc.xls"
PathToFile = "C:\Documents and Settings\me\My Documents"
Set File2Update = Workbooks.Open(PathToFile & "\" & NameofFile)
MyResult = Application.Run(File2Update.Name & "!MonthlyUpdate")
Windows(File2Update).Activate
ActiveWorkbook.Save
ActiveWorkbook.Close

End Sub


 
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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Application Error when running Macro on Workbook open TM[_2_] Excel Programming 1 October 2nd 03 10:53 AM
Application Error when running Macro on Workbook open TM[_2_] Excel Programming 0 September 15th 03 12:33 PM


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