Calling a vbscript from a jscript and returning a value
Copy link to clipboard
Copied
Hi,
i've been a longtime lurker here and thank you guys so much for everything so far! I have very limited JS knowledge and no VBS knowledge at all.
Anyways here's my problem:
I have already written a jsx script that opens a large excel file and does alot of stuff it needs to do with the PSD.
the excel is being opened using the "SheetJS/js-xlsx" library. Problem is that it is simply too slow. we're talking in terms of 10s of minutes for an excel with about 14000 cells filled. I've went thru the code for importing xlsx multiple times and can't find that i'm doing anything wrong. so my conclusion is that the library is simply too slow.
So my goal now is to move away from that library and read the xlsx file using some other way. And that's where my idea comes from:
Start the jsx script
which would call the VBA script that would read the xlsx
and return the content in any format (right now i'm working with an array of jsons)
and than the rest of the script will do it's work.
Is it possible to transfer it within the script? Or do i need to have the vba script save something temporary somewhere on hard drive which the jsx will than read?
I've found the .doScript that works for Indesign, but it doesn't work for PS.
Thanks in advance!
Explore related tutorials & articles
Copy link to clipboard
Copied
ExtendScript can call a system script, and you can write a Powershell script that will open and process Excel files via COM. I would explore that route. Microsoft has extensive documentation on working with Excel via VB and Powershell.
Copy link to clipboard
Copied
You may write vbscript inside of you .jsx code which is going to write it on your drive and then execute to process .xml.

