But it’s still giving issue.
FYI,
a. VBA script is being saved in notepad file with .vbs extension as well.
b. Enable All is being put in Excel application as well
c. Excel is being saved as .xlsx
d. VBA code I am trying to run:
Sub PC_Exists_in_SAP()
Columns(“A:B”).Select
Selection.Copy
Sheets("Mon Sheet 1 ").Select
Columns(“A:A”).Select
Selection.Insert Shift:=xlToRight
End Sub
Please help. Thanks in advance.
Error indicates that the macro that you are trying to run is not available in the workbook or that macros are disabled on the machine where you are running the script.
It could be like
The macro is in a different workbook than the one that you are trying to run the script in.
The macro was deleted from the workbook.
The macro was disabled in the workbook.
But the most common cause of this issue is related to macro security settings in Excel.
Macros may be disabled or set to a high security level on the machine where the automation is failing
Make sure this setting is enabled in others machine
Open an Empty excel or any excel file → Goto File-> Option ->Goto Trust Center → Trust Center Settings → Go to “Macro Settings” and choose a lower security level or enable macros.
Save it and restart excel
If this is done already but still if facing issue then ensure that the workbook (XLSB file) being accessed by your automation contains the macro named “Distribution file - Runall” as mentioned in the error message
Ensure that the XLSB file is in the expected location or in the expected sheet of the excel
Check this out
Check on these aspects and let us know for further clarification