I am receiving:
Run-time error ‘1004’: Cannot run macro Makros.xlm!MakroIni. The
macro may not be available in this workbook or all macros may be
disabled.
…when running a Macro in certain instances of Excel 2010. In some Excel 2010 installations and Excel 2003 it works fine.
There are 2 Workbooks involved: Macro.xlm and Username.xls. Both files are stored on a remote server.
The Macro crashes when executing:
Workbooks.Open Makro_Path & Makro_Nam, ReadOnly:=True
Application.Run Makro_Nam & "!MakroIni", WbTyp
The first line is proper executed and all macros are visible.
Makro_Nam is defined as:
Public Const Makro_Nam As String = "Makros.xlm"
What can i do?
Actually the cause was Excel 64 bit.
The Makro.xlm worksheet contained this function definitions:
I changed them to ptrsafe:
Now it seems to work.