REM
REM Pack the 32 xll
REM
xcopy "$(SolutionDir)packages\ExcelDna.AddIn.0.33.9\tools\ExcelDna.xll" "$(TargetDir)MyLib-AddIn.xll*" /C /Y
"$(SolutionDir)packages\ExcelDna.AddIn.0.33.9\tools\ExcelDnaPack.exe" "$(TargetDir)MyLib-AddIn.dna" /Y
REM
REM
REM Pack the 64 xll
REM
xcopy "$(SolutionDir)packages\ExcelDna.AddIn.0.33.9\tools\ExcelDna64.xll" "$(TargetDir)MyLib-AddIn64.xll*" /C /Y
"$(SolutionDir)packages\ExcelDna.AddIn.0.33.9\tools\ExcelDnaPack.exe" "$(TargetDir)MyLib-AddIn64.dna" /Y
REM
REM
REM Copy the xlls
REM
xcopy "$(TargetDir)MyLib-AddIn64-packed.xll" "$(SolutionDir)_ExcelDeployment\MyLib-AddIn64-packed.xll*"/C /Y
xcopy "$(TargetDir)MyLib-AddIn-packed.xll" "$(SolutionDir)_ExcelDeployment\MyLib-AddIn-packed.xll*"/C /Y
REM xcopy "$(TargetDir)MyLib.dll" "$(SolutionDir)_ExcelDeployment\MyLib.dll*"/C /Y
I would then distribute an xla, that would open one of these two xlls depending on the bitiness of the users machine......
in VBA.....
Private Declare PtrSafe Function GetProcAddress Lib "kernel32" _
(ByVal hModule As Long, _
ByVal lpProcName As String) As Long
Private Declare PtrSafe Function GetModuleHandle Lib "kernel32" _
Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long '()
Private Declare PtrSafe Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare PtrSafe Function IsWow64Process Lib "kernel32" _
(ByVal hProcess As Long, ByRef Wow64Process As Long) As Long
Public Function Check_OS_IS_64() As Boolean
Dim Its64 As Long
Dim handle As Long
handle = GetProcAddress(GetModuleHandle("kernel32"), _
"IsWow64Process")
If handle > 0 Then ' IsWow64Process function exists
' Now use the function to determine if
' we are running under Wow64
IsWow64Process GetCurrentProcess(), Its64
End If
If Its64 = 1 Then
CheckWhetherIts64 = True
Else
CheckWhetherIts64 = False
End If
End Function
Public Function Check_Excel_IS_64() As Boolean
Check_Excel_IS_64 = False
#If Win64 Then
Check_Excel_IS_64 = True
#End If
End Function