I’ve recently updated to 64 bit Office (on Windows 10 64 bit) due to spreadsheet bloat, so am trying to call the epanet2.dll from Excel VBA. Am trying to get the OWA Epanet 2.1 running, since I had no problems on 32 bit Excel.
Have updated the declarations module to include 64 bit VBA 7.0 reference
#If VBA7 Then
’ 64 bit version of office VBA
Declare PtrSafe Function ENepanet Lib “epanet2.dll” (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As Any) As LongPtr
Declare PtrSafe Function ENopen Lib “epanet2.dll” (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String) As LongPtr
Declare PtrSafe Function ENsaveinpfile Lib “epanet2.dll” (ByVal F As String) As LongPtr
Declare PtrSafe Function ENclose Lib “epanet2.dll” () As LongPtr
With 32 bit office, the 32 bit epanet2.dll was saved in C:\Windows\SysWOW64
so with 64 bit office, the 64 bit epanet2.dll should be saved in C:\Windows\System32
Although a bit confusing, the placement of 32 and 64 bit .dll files is as described here:
There should be no need to register the .dll using the Windows\System32 regsvr32 (trying to do so raises an error)
However, I’ve had no luck. Have tried both 32 and 64 bit .dlls in both System32 and SysWOW64 folders. Any ideas would be welcome!