Importing Excel data to Drive Simulation

Hi,

I want to use the data in a Excel file to drive my simulation automatically. I downloaded the xlrd library, but what should I do before I can use the library.

Best wishes

Hello,

I spent a lot of time trying to do the same, using the openpyxl library. One way to load external libraries is to put them directly into the python directory C:\Program Files\Visual Components\Visual Components Professional 4.0\Python\lib

However, Visual Components has a bug in the stackless python environment wherein importing an external library works the first time a file is opened, but if you go File->Clear All, or simply open a different file without closing Visual Components, and then try to import the library again, the import will often fail. You must restart VC to reset the python environment.

To find a list of all of the path directories into which you can place external libraries, simply add a script behaviour to a component, enter the following:

import sys
print "\n".join(sys.path)

Hi,

I put the library into C:\Program Files\Visual Components\Visual Components Professional 4.0\Python\lib\site-packages, but it does not work. Should I install it first?How? Attachments are the library file.

Best wishes.

openpyxl-2.5.0a1.tar.gz (164 KB)

Did you put an init file in the site packages directory?

I’ve solved the problem! Thanks for your advice, it helps a lot :slight_smile:

Hey wangchengyang,

how could you solve the problem?

Please share the way you solve it… :slight_smile:

Unzip the attached file, and put the folder openpyxl into the directory C:\Program Files\Visual Components\Visual Components Professional 4.0\Python\lib\site-packages

 

 

 

hi,

recently I am learning how to import and export excel, I have the same problem and I following your step, but there is an error as below.

so I download jdcal-1.4.1.tar and unzip it to D:\VC4.1premium\Python\lib\site-packages, but it still have the same problem. Do someone know how to solve this problem?

Hi Jerry,

from the “jdcal-1.4.1.tar”, extract only the “jdcal.py” file to D:\VC4.1premium\Python\lib\

Launch/restart VC and should be then available for importing.

Thanks Jouha

Can you share the download link of jdcal-1.4.1.tar

①place openpyxl into site-packages folderPlace openpyxl in the site-packages folder

②Place jdcal.py in the lib folder

Place jdcal.py in the lib folder

③ The following error occurred at runtime

error code

④So I downloaded et_xmlfile-1.0.1 again and put et_xmlfile into the site-packages folder

et_xmlfile

The reference aspect is fine, but the runtime error is as follows:

from vcScript import *
from openpyxl import workbook

def OnSignal( signal ):
  pass

def OnRun():
  wb=workbook()
  ws=wb.active()

TypeError: ‘module’ object is not callable

Ask everybody to help me, how should be correct operation method?