Hi,
I have a long list of functions written in VB.Net code, I want to implement them into excel but I am finding much difficulty in doing so.
This is what I have been trying:
- I'm using Visual Studio Community 2013
- My code is in a Vb.Net Class library project with ExcelDNA installed.
- I run the code, go to the bin/debug folder and copy three files to a folder on my desktop: .dna file, .dll file and -AddIn64.xll file. (I have read on various pages that the .dll file is not needed for distribution, but If I'm right this is only for ExcelDNA written in C#?)
- In Excel 2013, I load the .xll file in the Addins window. Thus far Excel loads it with no problem, I am not prompted to enable macros or any such thing.
- I click on an empty cell and enter '=V' to see if my function will popup in the list of available functions. It doesn't
- I try using my function despite it not appearing as an available function. Excel returns '#NAME?'
through my own troubleshooting these are things I have changed:
- used the AddIn64.xll instead of AddIn.xll file (my PC is x64, although most all PCs in my workplace are x32) NOTE: when loading excel gave a warning that the .DNA config file could not be found. I simply added a '64' to the end of the .DNA filename and then it loaded.
- added 'Imports ExcelDna.Integration' to the top of my .vb file in Visual studio
- tried loading Addin on a coworker's computer? (I have a trial version of MS office, if that matters) went exactly as when I loaded addin in my computer. loads fine, function(s) won't appear.
Here's sample code for one of my functions
Public Function V_TdbW(Tdb, W, P)
' This function calculates Moist air volume given dry bulb temperature(F), humidity ratio(lblb), and pressure(psi).
' ASHRAE Fundamentals (2009) ch. 1 eqn. 28
' V_TdbW (o) Specific Volume [ft3lb]
' TDryBulb (i) Dry bulb temperature [F]
' HumRatio (i) Humidity ratio [lbH2OlbAIR]
' Pressure (i) Atmospheric pressure [psi]
V_TdbW = 0.370486 * (FTOR(Tdb))(1 + 1.607858 * W)(P)
End Function
That's pretty much it. I tried all of the links and tutorials I could find online. I found a lot of the links were no longer working, such as the
Methodsinexcel.co.uk tutorials. Other tutorials explained how to implement a C# addin which is not what I need. I think a tutorial video on youtube would be extremely beneficial, or one simple tutorial online.