Using a VBA program

I have a VBA file from an RSView32 application that I would like to use in my ignition project. From what I’ve gathered VBA language is not used in Ignition. The VBA program has multiple routines that calls and sets recipes from an excel file. Looking for some insight on how to go about using this VBA and excel program in Ignition.

I don’t think you’re going to be able to call this VBA code from Ignition. Your best bet is probably going to be to port the script to Jython.

You will probably run into problems interacting with the Excel file though - I don’t think Ignition can do very much in that area. Certainly not as much as VBA can since it’s coupled with Windows and probably has all kinds of hooks into excel via COM.

Thanks for the response Kevin.

Would you recommend recreating the excel file in another program, that can talk with ignition better? If so where? I’ve been trying to create the excel file as a table in a Microsoft SQL database. Is that an option or would that not work?

I’m not sure, I guess it depends on what you actually need to do with the data in the file. Ignition is pretty capable when it comes to interacting with a database, so that option could be the way to go…

The excel file has a list of recipes with numerous specs. In Ignition I call a certain recipe number and that uploads all the specs for that recipe. I also need to be able to frequently edit or add to those recipes. Using the excel file was simple as all I needed to do was refernce the cells, but I’m not sure how to do the same thing using a database.

I’ve been trying to mimic the Load Recipe youtube video, but haven’t had success with applying that to my application.

You absolutely should move the data that is excel into a database - this is the kind of thing they’re made for!

I should also say that this is the kind of task our Design Services department could easily handle and help you create a 1st-class setup in a jiffy if you don’t want to slog through it yourself.

If you do want to DIY then you’ve got to break this problem down into steps. Step 1: Get the excel data into a database. You might have some luck exporting each sheet of the excel file into CSV and importing those into their own database tables. It’s hard to give precise advice without seeing the data.