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?



  • created

    Nov '16
  • last reply

    7h
  • 10

    replies

  • 1.5k

    views

  • 4

    users

  • 5

    likes

  • 3

    links

  • 6



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

@Raja did you ever fine a solution to this? i am having same issue with my team not always having bumblebee installed - so using the built in read / write excel would be be easier for sharing scripts.





@Atkins14 sorry for such a late reply, there isnt any solution for me untill now.





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]:
ex = Excel.ApplicationClass()
xlApp = Marshal.GetActiveObject("Excel.Application") 
xlApp.Visible = True
xlApp.DisplayAlerts = False
xlApp.Workbooks.Close()
xlApp.Quit()
OUT = “Success”




16 DAYS LATER

Hi @Atkins14,
Took so long for me to return to this forum. many thanks for stitching the code, with my basic python knowledge I have edited yours a bit with True or False statement , here below.
from System.IO import Directory

Comments

Popular posts from this blog

Powerpoint countdown and current time in slides VBA

Revit area plans adding new types and references (Gross and rentable)