I got a .xll file that I can easily add to excel by doing this: Options > Addins > Browse > double click .xll file It gets imported + activated (and it remains in my excel addins every time I close and open Excel).
This is the manual way I try to replace with a script.
PowerShell
$excel=New-Object -ComObject excel.application
$excel.RegisterXLL("C:\temp\v-0.0.1-20210906\LS-ZmqRtd-AddIn64.xll")
$excel.Visible = "$True"
#$excel.Quit()
This will create an instance of Excel, register the XLL (I get a "true" in my console) and show the created instance. But when I then go to AddIns, the AddIn isn't there.
Python
xl = win32com.client.gencache.EnsureDispatch("Excel.Application")
xl.Visible = True
xl.RegisterXLL(
"C:/Users/michael.k/Desktop/v-0.0.1-20210906/LS-ZmqRtd-AddIn64.xll"
)
wb = xl.Workbooks.Open("C:/Users/michael.k/Desktop/v-0.0.1-20210906/Test.xlsx")
But this behaves like the Powershell script.
So.. how can I add my .xll file into Excel to stay there permanently? Any suggestions?
Thanks in advance!