You have two options: "direct debug" or "attach".
I strongly prefer the “direct debugging” approach for the long list of reasons omitted here.
Both sides of the DLL and Excel / VBA require steps; your publication is unclear if all of these steps are addressed.
The options are as follows:
1) VS, , " " " " " ( ) ", "" "".
a) " " "" - VS ver. Excel exe
b) , " " , xls ( - ) " " " " VS ver,
, (, / ).
c) Dir, "", , Dir, AddIn (c.f., DLL Debug ( Release) Dirs)
... , DLL , , DLL, DLLEXPORT .. ..
... DLLEXPORT ( ) Calling Convention ... , ( , Excel- ).
... DLL DLL_Main, , .
2) , "" Excel DLL, .. "". .xla, .xll. .xla .
. Excel .. .xla
() XLA VBA / .. DLL. , DLL Add2_DLL.dll, "add2_pho_xl", :
Public Declare Function Add2_Pho_XX Lib "E:\EclipseWorkSpace\Add2_DLL\Debug\Add2_DLL.dll" _
Alias "add2_pho_xl" (A As Double, B As Double) As Double
Alias , , .
(UDF) .. / VBA VBA, "" UDF, (. ). , , (, ..).
:
a) DLL , . Addin ... .
b) DLL. DLL ( .Def), DLL- Private, , DLL.
"" - Calling Convention , :
"_ add2_pho_xl_ @08" .., .
... , , DLL.
3) .xla, dll ( , Dir), Excel "" . - Excel/Tools/Addins, "" DLL-.
4) CRUCIALLY, / DLL Calling Convention. ( ) "":
(i) VBA , Bool/Logical DLL 1 , Debug , " ".
(ii) ... . , ByVal ByRef, , DLL " " Args .. .. , VBA COM/OLE VBStrings, .
(iii) /:
5) (, , ) , VS , , "Go" "" ( VS ver ..). Excel, xls, . (), ( = add2_pho_XX (A1, B1)), ( "fx" , ).
:
a) func / .. Excel VS, , , Arg (, Double to Int ) ..
b) ( VS) VBA. , VS bebug, VBA IDE UBA UBA, "Spinner" UDF. , VBA UDF, DLL.
Private Function Add2_Pho( FirstNum as Double, SecondNum as Double, Optional lMakeRed as Variant) As Variant
'
'
Add2_Pho = Add2_Pho_XX( FirstNum, SecondNum ) ' this is the actual DLL func accessed via Delcare above
'
If( IsMissing(lMakeRed) ) Then
Else
If( cBool(lMakeRed) ) Then
If( Add2_Pho < 0 ) Then
'
' ' make the result Red, or something
'
End If
End If
End If
'
'
End Function
... , , UDF VBA. , "" VBA , VS, , Args, Calling Convention .. ..
c) #Value - , , , UDF , , - , VBA, VBA- > DLL, DLL- > VBA
d) ! VBA IDE Debug/Compile VBA Project, -, , VBA.
e) , VBA/XLA, CleanProject (VBA , )