View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default public const availability?

There was a typo on the Application.Run string and in the spelling of Public
for the function - but fixing those I recreated the situation

In the workbook named ABC.xls, in Module1

Public Const MyVal As Long = 10

Public Function ReturnMyVal()
ReturnMyVal = MyVal
End Function

in another workbook

Sub GettheValue()
v = Application.Run("ABC.xls!ReturnMyVal")
MsgBox v
End Sub

the message box displayed 10

--
Regards,
Tom Ogilvy


"lcoreyl" wrote in
message ...

keep getting "macro not found"

tried creating (in the book with the constant) a macro named ABC with
just the function in it, and still get the same error...


--
lcoreyl
------------------------------------------------------------------------
lcoreyl's Profile:

http://www.excelforum.com/member.php...fo&userid=2042
View this thread: http://www.excelforum.com/showthread...hreadid=552950