Results 1 to 7 of 7

Calling macro from another workbook

Threaded View

  1. #1
    Registered User
    Join Date
    03-21-2014
    Location
    Essex, England
    MS-Off Ver
    Excel 2008
    Posts
    16

    Calling macro from another workbook

    Hi,

    I open a .csv file and run a personal macro on it to format the data. It then opens another file, in which I want it to run a macro within the workbook.
    I have the below code, but his keeps giving me the error
    "Run-time error '1004': Cannot run the Macro '!MakeChanges'. The macro may not be available in this workbook or all macros may be disabled."

    I can enter the workbook and manually execute the macro (therefore macros are not disabled), but want it to automatically run, from my personal macro.

    This is my code

    Public Sub MakeChanges()
    
     Dim  toolWB As Workbook
    
     Workbooks.Open Filename:= _
            "C:\Users\me\Desktop\DataTest.xlsm", Password:="abcde"
        
     Set toolWB = ActiveWorkbook
    
    
    toolWB.Application.Run ("!newiTime")

    What is causing the error and how can I fix this? Any help, greatly appreciated!!
    Last edited by alansidman; 08-18-2017 at 06:52 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Manipulating ActiveWorkbook when calling macro from Personal Macro Workbook
    By 146considerations in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-05-2017, 12:16 AM
  2. Error when calling a 'sheet macro' inside a workbook wide macro
    By Rhino_dance in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-09-2016, 03:46 PM
  3. Calling a macro in a protected workbook
    By GJChurchward in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2015, 07:18 AM
  4. calling an event macro from a different workbook
    By cwchan220 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-25-2014, 10:32 AM
  5. Calling Macro on Closing of Workbook
    By Dirigo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2011, 02:57 PM
  6. Calling macro in another workbook
    By scabral in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2009, 02:03 PM
  7. Calling Macro From Different Workbook
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-23-2008, 07:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1