Skip to content

Commit 843d133

Browse files
Minor changes
- now statically linking MSVC runtime lib to avoid DLL issues - xlwings compatibility - now sets xl_workbook_current instead of xl_workbook_latest as per v0.3.0 - bumped version
1 parent d06928d commit 843d133

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

addin/xlpython.xlam

-76 Bytes
Binary file not shown.

addin/xlpython/xlpython.bas

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ Option Explicit
44

55
#If VBA7 Then
66
#If win64 Then
7-
Const XLPyDLLName As String = "xlpython64-2.0.7.dll"
8-
Declare PtrSafe Function XLPyDLLActivate Lib "xlpython64-2.0.7.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
9-
Declare PtrSafe Function XLPyDLLNDims Lib "xlpython64-2.0.7.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
7+
Const XLPyDLLName As String = "xlpython64-2.0.8.dll"
8+
Declare PtrSafe Function XLPyDLLActivate Lib "xlpython64-2.0.8.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
9+
Declare PtrSafe Function XLPyDLLNDims Lib "xlpython64-2.0.8.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
1010
#Else
11-
Private Const XLPyDLLName As String = "xlpython32-2.0.7.dll"
12-
Private Declare PtrSafe Function XLPyDLLActivate Lib "xlpython32-2.0.7.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
13-
Private Declare PtrSafe Function XLPyDLLNDims Lib "xlpython32-2.0.7.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
11+
Private Const XLPyDLLName As String = "xlpython32-2.0.8.dll"
12+
Private Declare PtrSafe Function XLPyDLLActivate Lib "xlpython32-2.0.8.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
13+
Private Declare PtrSafe Function XLPyDLLNDims Lib "xlpython32-2.0.8.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
1414
#End If
1515
Private Declare PtrSafe Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
1616
#Else
1717
#If win64 Then
18-
Const XLPyDLLName As String = "xlpython64-2.0.7.dll"
19-
Declare Function XLPyDLLActivate Lib "xlpython64-2.0.7.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
20-
Declare Function XLPyDLLNDims Lib "xlpython64-2.0.7.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
18+
Const XLPyDLLName As String = "xlpython64-2.0.8.dll"
19+
Declare Function XLPyDLLActivate Lib "xlpython64-2.0.8.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
20+
Declare Function XLPyDLLNDims Lib "xlpython64-2.0.8.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
2121
#Else
22-
Private Const XLPyDLLName As String = "xlpython32-2.0.7.dll"
23-
Private Declare Function XLPyDLLActivate Lib "xlpython32-2.0.7.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
24-
Private Declare Function XLPyDLLNDims Lib "xlpython32-2.0.7.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
22+
Private Const XLPyDLLName As String = "xlpython32-2.0.8.dll"
23+
Private Declare Function XLPyDLLActivate Lib "xlpython32-2.0.8.dll" (ByRef result As Variant, Optional ByVal config As String = "") As Long
24+
Private Declare Function XLPyDLLNDims Lib "xlpython32-2.0.8.dll" (ByRef src As Variant, ByRef dims As Long, ByRef transpose As Boolean, ByRef dest As Variant) As Long
2525
#End If
2626
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
2727
#EndIf

addin/xlpython_xlam_vba_code.bas

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ Sub ImportPythonUDFs(control As IRibbonControl)
224224
End If
225225

226226
If Py.Bool(Py.GetItem(xlfunc, "xlwings")) Then
227-
f.WriteLine sTab + "Py.SetAttr Py.GetAttr(Py.Module(""xlwings""), ""xlplatform""), ""xl_app_latest"", Application"
228-
f.WriteLine sTab + "Py.SetAttr Py.Module(""xlwings.main""), ""xl_workbook_latest"", ThisWorkbook"
227+
f.WriteLine sTab + "Py.SetAttr Py.Module(""xlwings._xlwindows""), ""xl_workbook_current"", ThisWorkbook"
229228
End If
230229

231230
f.WriteLine sTab + "Set xlpy = Py.Module(""xlpython"")"

xlpython/xlpython.vcxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@
6666
<LinkIncremental>true</LinkIncremental>
6767
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
6868
<IntDir>$(Platform)\$(Configuration)\</IntDir>
69-
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.7</TargetName>
69+
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.8</TargetName>
7070
</PropertyGroup>
7171
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7272
<LinkIncremental>true</LinkIncremental>
7373
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
7474
<IntDir>$(Platform)\$(Configuration)\</IntDir>
75-
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.7</TargetName>
75+
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.8</TargetName>
7676
</PropertyGroup>
7777
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7878
<LinkIncremental>false</LinkIncremental>
7979
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
8080
<IntDir>$(Platform)\$(Configuration)\</IntDir>
81-
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.7</TargetName>
81+
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.8</TargetName>
8282
</PropertyGroup>
8383
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8484
<LinkIncremental>false</LinkIncremental>
8585
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
8686
<IntDir>$(Platform)\$(Configuration)\</IntDir>
87-
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.7</TargetName>
87+
<TargetName>$(ProjectName)$(PlatformArchitecture)-2.0.8</TargetName>
8888
</PropertyGroup>
8989
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9090
<ClCompile>
@@ -131,6 +131,7 @@
131131
<FunctionLevelLinking>true</FunctionLevelLinking>
132132
<IntrinsicFunctions>true</IntrinsicFunctions>
133133
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;XLPYTHON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
134135
</ClCompile>
135136
<Link>
136137
<SubSystem>Windows</SubSystem>
@@ -153,6 +154,7 @@
153154
<FunctionLevelLinking>true</FunctionLevelLinking>
154155
<IntrinsicFunctions>true</IntrinsicFunctions>
155156
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;XLPYTHON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
157+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
156158
</ClCompile>
157159
<Link>
158160
<SubSystem>Windows</SubSystem>

0 commit comments

Comments
 (0)