LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Can I still register a function in a DLL using ExecuteExcel4Macro REGISTER?

Hi,

I have created by own simple DLL using C in VS 2010, which contains just one function.

Looking at some of the articles etc. on the web, it is suggested I can register this function in VBA using some code like this:

Sub VBARegisterFunction()

Dim sP As String, sDQ As String

sDQ = Chr(34) 'Double quotes

sP = ""
sP = sP & sDQ & "C:\Users\Owner\docs\vs2010\Projects\Test\Test.dll " & sDQ & ","
sP = sP & sDQ & "cube" & sDQ & ","
sP = sP & sDQ & "BB" & sDQ & ","
sP = sP & sDQ & "cube" & sDQ & ",,1"

Application.ExecuteExcel4Macro ("REGISTER(" & sP & ")")

End Sub

without going to the trouble of creating a full blown XLL, which is attractive just to get one simple function running.

When I run this code, I see no visible error, and I am aware that the function if successfully registered, is hidden. But I get #Value! errors when I try to reference the function in a cell.

Does anyone know, what I am doing wrong, or if this feature still works in Excel 2007/2010?

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbook register Alpha Excel Programming 1 February 20th 10 04:06 AM
Checking Register Bob[_13_] New Users to Excel 3 January 17th 08 02:48 AM
Check Register Lavert Excel Discussion (Misc queries) 1 July 23rd 07 04:10 PM
Checkbook Register PurpleBabs Excel Discussion (Misc queries) 5 April 26th 06 12:03 AM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"