While it is possible to run a datanitro script via VBA, this still requires excel to be open. Is it possible to have a .py file that executes datanitro (like opening and closing an excel file) without a human needing to be present to open excel and execute the script?
If it isn't possible yet is it in the works?
DataNitro needs to have Excel open before you can run it, but you can have a script start automatically when a workbook is opened (https://datanitro.com/docs/scripts.html#autostart).
You can combine that with a Python script (outside of DataNitro) or other script to open and close the Excel file and launch the process automatically.
Related
I am working on a selenium testng frame work where I am downloading the Excel file, but as it is opening automatically I am not able to execute further script, is there any way where this file does not open automatically or opens in background?
I've been trying to search for similar questions but wasn't able to find much for precisely what I'm looking for. I could have missed it in my search - if any of you can find a previous thread for this, please link it for me :)
Essentially what I'm trying to achieve is to fully automate an Excel report, which involves running a macro that I have a .BAS file for. I've seen tutorials for how to create a .VBS and .BAT script to automate the running of macros, but I wan't to also automate the importing of the macros. For example:
- I have my base dataset that I want to run the macro on, which comes in a standard Excel file (xlsx), which I save in a consistent location
- I have my .BAS file which contains the macro I want to use every time, saved in a different location from my reports
- What I am seeking: to have a .BAT file on my desktop that will automate: 1) Opening my standard xlsx file, 2) Saving it as an xlsm, 3) Importing my .BAS file with my macro, 4) Executing the macro, and 5) Closing Excel.
The key part I am missing is how to have the .BAT script automatically import the .BAS module into my Excel file. If I have to manually open Excel and import the module, I might as well just manually run the macro as well, thus eliminating the purpose of trying to create a .BAT file to automate :)
If anyone can provide guidance, that would be much appreciated. I hope my post was clear - if any questions, I can clarify in comments.
I have some xlsm files with VBA script inside and hope that can automatically run VBA script by nodejs code. Is that possible with nodejs?
I have searched for a while but it seems like we only can add VBA script into xlsx files, not execute the code.
File here
Any advice is welcome!
I'm running some task on Linux which produces certain CSVs. Once they’re produced, I need to copy them into different sheets of an excel file and then run some VBA macros to generate a report. Since this has to be done multiple times a day (with no pre-defined/fixed schedule), I’d like to automate it.
Here is what I tried:
I wrote a VBScript, which takes the CSV files and other required input files, opens an excel file, copies the CSVs into the excel, runs some VBA macros, and saves and closes the result. This VBScript works fine when triggered locally on a windows server.
I have uploaded a simpler version of the files involved here which somewhat clarify my requirements (Note that the macros I need to run are much more complicated (~500 lines) compared with the macros here).
There are four files inside the archive:
Template.xlsm: The Excel template of the report into which data is to be pasted
Input_Sheet2.csv : The input data to be pasted into the template into sheet 2
Input_Sheet3.csv : The input data to be pasted into the template into sheet 3
Run.vbs: The vbscript which triggers the “copy-paste” macro present inside the Excel template.
The command to run the VBScript is: ‘cscript //Nologo Run.vbs /NoCancel’
Now, in order to automate whole task, I thought to trigger this VBScript remotely from Linux over ssh. I installed the cygwin ssh daemon on the windows box and facilitated ssh connections from the Linux machine. This cygwin ssh connection from Linux allows to run several windows commands, but fails to run the VBScript and doesn't produce any excel output.
I can't figure out which component has limitations. Is it cygwin ssh not facilitating execution of VBScript? Is it VBScript not facilitating creation of files remotely? Is it ssh client on Linux not allowing opening of excel in GUI format? Or there is another way to automate this task from Linux.
Thanks,
Shubham
I'd focus on:
Did you test running your script from the Cygwin Terminal? (I did try a simple script, that opened Execl (.Visible = True) successfully, so I believe your fears concerning cygwin not allowing to open the Excel GUI are unnecessary).
Do the sshd user account's path and cwd allow the short invocation "cscript Run.vbs" or should the long version "/cygdrive/c/WINDOWS/system32/cscript.exe /home/user/Run.vbs" be used?
Does the sshd user have access/permissions to all involved files and folders?
You didn't forget the unix file systems are case sensitive? (I did and wasted some time)?
is there a way how to make Matlab open excel files directly in MS Excel? I do not mean just read data, but physically open MS Excel.
I have a script that processes some data and saves it into .xlsm. This .xlsm contains auto_open macro which generates a report and saves it into another .xls.
I want the process to be as automatic as possible. So far, when the matlab script ends, .xlsm file needs to be open manually. Is it possible to do it via Matlab? (The .m file and .xlsm are in the same folder.)
The simplest way to open (but not close) an Excel file is to use WINOPEN:
winopen('myFile.xlsx')
Excel has a powerful COM interface that lets you control it from another application.
Look here for the matlab side of things
http://www.mathworks.co.uk/help/techdoc/ref/actxserver.html
And here for an example of putting it all together . . .
https://www.quantnet.com/forum/threads/interface-between-matlab-vba-excel.2090/
or here is another example
http://www.mathworks.co.uk/support/solutions/en/data/1-716EAM/index.html?solution=1-716EAM
Yes, it is possible. Matlab can use Excel's Automation interface to do this and similar tasks. The following code loads Excel and then loads a workbook:
try
w = actxserver('Excel.Application'); % Fails if Excel not installed
catch
w = [];
end
if ~isempty(w)
w.Workbooks.Open('D:\Documents\MATLAB\file.xlsx');
% Your code here;
w.Quit;
end
delete(w);
You will need to look at Microsoft's documentation for the Excel automation interface to figure out exactly what commands you need to send. Try starting here.
I have used this technique to drive Word from Matlab in order to produce a report document, but I have never used Excel this way, so unfortunately I can't help you with the gory details!