- Get link
- X
- Other Apps
For finding the Public Tokens for Python or other code that requires inclusion of assemblies- thread on finding those and an more basic excel python connector from my version in previous and later posts- is included here for reference.
Refer to the C:\Windows\assembly folder- the public token Key is listed there!
---
https://forum.dynamobim.com/t/read-excel-file-node-opens-excel-file/7813
Refer to the C:\Windows\assembly folder- the public token Key is listed there!
---
https://forum.dynamobim.com/t/read-excel-file-node-opens-excel-file/7813
Hello All,
Whenever I try to run the “Read.Excel” node in dynamo it opens the excel file along with it. Is there a way to stop opening the excel file?
Whenever I try to run the “Read.Excel” node in dynamo it opens the excel file along with it. Is there a way to stop opening the excel file?
created
last reply
- 10
replies
- 1.5k
views
- 4
users
- 5
likes
- 3
links
Thanks @Konrad_K_Sobon I use Bumblebee for my personal use, but when i have to give the visual code to others who doesn’t have the package i either should ask them to install it or use the default nodes in dynamo. In the latter case I came across this issue so i was wondering why.
6 MONTHS LATER
i have put together a bit of python code which closes the active workbook, you should be able to copy and paste the below code in. It uses an if statement as a trigger. Its a bit messy as you need to use this everytime a spreadsheet is opened. Ideally, would want this to run right at the end and close specific excel files. Hope it helps.
from System.IO 4 import Directory
import re
import time
import sys
sys.path.append(‘C:\Program Files (x86)\IronPython 2.7\Lib’)
import subprocess
import os
import errno
import csv
import clr
clr.AddReferenceByName(‘Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’)
from Microsoft.Office.Interop import Excel
from Microsoft.Office.Interop.Excel import ApplicationClass
from System.Runtime.InteropServices import Marshal
if “Completed” in IN[0]:
from System.IO 4 import Directory
import re
import time
import sys
sys.path.append(‘C:\Program Files (x86)\IronPython 2.7\Lib’)
import subprocess
import os
import errno
import csv
import clr
clr.AddReferenceByName(‘Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’)
from Microsoft.Office.Interop import Excel
from Microsoft.Office.Interop.Excel import ApplicationClass
from System.Runtime.InteropServices import Marshal
if “Completed” in IN[0]:
ex = Excel.ApplicationClass()
xlApp = Marshal.GetActiveObject("Excel.Application")
xlApp.Visible = True
xlApp.DisplayAlerts = False
xlApp.Workbooks.Close()
xlApp.Quit()
OUT = “Success”
16 DAYS LATER
Comments
Post a Comment