VBA Error 1004: The Macro 'sgc' cannot be found.

purceld2

Registered User.
Local time
Today, 21:38
Joined
Dec 4, 2008
Messages
79
Has anybody have any idea what is causing the above error the line of code is

XlObj.Run "sgc"

“sgc” is a macro which I have in my Excel Personal.xls workbook. I have noticed that when the code opens the spreadsheet Personal.xls is not there it is just empty but when you open the spreadsheet manually the macro is available any ideas?

Thank you in advance
 
I would suggest stepping through the code and reviewing the variables from line to line. My first stab in the dark would be to check references...
 
It appears that when excel is opened by an external program it does not open the personal.xls file. its fine when opened directly. this is why i am getting the Error 1004.

does anybody know why.
 
It appears that when excel is opened by an external program it does not open the personal.xls file. its fine when opened directly. this is why i am getting the Error 1004.

does anybody know why.
This is by design, it prevents the possibility of auto-running macros, thereby giving you more control over automating excel. Open it manually.
 

Users who are viewing this thread

Back
Top Bottom