View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JacksonRJones JacksonRJones is offline
external usenet poster
 
Posts: 15
Default xllRegister method

Thanks a million. It worked and now I get to go home on a positive note
after a few days of banging my head against the wall.

"Peter T" wrote:

Are you saying registerxll fails. AFAIK you only need to register it once so
if your function works in Excel I guess it should work in VBA, though you
need ExecuteExcel4Macro and the right syntax (following might not be right)

c = Application.ExecuteExcel4Macro("AddTwo(" & 8 & "," & 9 & ")")

Regards,
Peter T

"JacksonRJones" wrote in message
...
hi. I'm still trying to use xll files to be able to use c++ code for

custom
excel functions. No one seems to be fielding these questions, but I

thought
I'd try again. I'm trying to use the xllregister method in vba to call
functions in an xll file. here is the code:

sub main()
Application.registerxll "filename.xll"
Dim c As integer
c = AddTwo(8,9)
...
End Sub

I get an error message "sub or function not defined"
The addtwo function from my xll works fine when used in excel. Any
thoughts? I'm pretty much out of my league at this point, but I have to

get
this done for work. Pls help.