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
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