Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating DLLs for Office

Status
Not open for further replies.

MikeDutcher

Technical User
Jun 19, 2001
10
US
I am an actuary, competent in app development but not by formal training.

15 years on the mainframe, pcs now strong enough to use instead.

I want to create functions that I can use from Excel or Access.

I have Visual Basic 6.0 and Office 2000.

Here's how far I've gotten. Suppose the function I want to create converts Fahrenheit to Celsius:

In VB I wrote the following code:

Public Function FtoC(Fahrenheit As Double) As Double
FtoC = 5 * (Fahrenheit - 32) / 9
End Function

Out of this code I made a DLL.

I pointed Excel & Access to the DLL library, but they could not "find" the function unless I put the following in a VBA module:

Function GetTemp(Temp As Double) As Double
GetTemp = FtoC(Temp)
End Function

Now to my question:

How can I avoid using VBA as a middle man to get to the FtoC function?

I want the Excel cell to be =FtoC(50)

rather than =GetTemp(50)

As it stands, it seems like I'm doing more work (& will have more to maintain)than I should have to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top