calling macro from other file: the macro may not be available in this workbook or all macros may be disabled

gigiot

New Member
Joined
Aug 10, 2015
Messages
1
I am running a macro that is calling a macro from another file. however, everytime i receive this error message: can not run the macro '' the macro may not be available in this workbook or all macros may be disabled
I tried many codes but it still does not work, any suggestion? here you can find the piece of codes and all the tentative:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> Application.FileDialog(msoFileDialogFolderPicker).Title = "choose folder where to save the summary"
Application
.FileDialog(msoFileDialogFolderPicker).Show
directory2
= Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1)
directory1
= directory2 & "\Summary " & ThisWorkbook.Sheets("Input").Range(inputName).Value & ".xlsm"



Set TargetWorkbook = Workbooks.Open(directory1)
TargetWorkbook
.Application.DisplayAlerts = False
Set TargetSheet = TargetWorkbook.Sheets("summary")
inputName
= "Location"
TargetSheet
.Range(inputName).Value = directory

'from here onwards all my attempts

'Application.Run "'" & directory1 & "'!test"
'Call TargetSheet.test
'Application.Run (TargetWorkbook.Name & "!test")
'Application.Run TargetSheet.Shapes(1).OnAction
'Application.Run ActiveSheet.Shapes(1).OnAction
'Application.Run (ActiveSheet & "!test")
TargetWorkbook
.Application.Run ("test")
TargetWorkbook
.Application.DisplayAlerts = True</code>thanks
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top