Call vba from bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Call vba from bash
# 1  
Old 10-26-2015
Call vba from bash

I am writing a bash function and am having trouble calling a VBA from within it. The line in bold is the path to the VBA. Thank you Smilie.

Code:
ngs() {
    call {C:\Users\cmccabe\Desktop\Sanger\NGS_Sanger.xlsx}
   cd 'C:' C:/Users/cmccabe/Desktop/Python27/
    for file in C:/Users/cmccabe/Desktop/Python27/*_sanger.txt
  do
    cat $file >> c:/Users/cmccabe/Desktop/Python27/out.txt
  done
  convert
}

# 2  
Old 10-26-2015
For starters, that's an Excel workbook. "Executing" it just means opening in in Excel.
# 3  
Old 10-26-2015
That is what is done currently, but what I am trying to do (if possible) is incorporate that VBA in the bash, so it opens automatically if that option is selected. Thank you Smilie.
# 4  
Old 10-26-2015
The problem is not running VBA then, it's convincing Excel to open the spreadsheet, run all the vbscript, and quit from the commandline.
# 5  
Old 10-26-2015
The stand-alone VBA (NGS_Sanger) when opened asked the user for a file, does several things, exports a text file, and closes. I am trying to call that from a bashmenu. If the VBA can be opened from within the bash it will save some steps. Thank you Smilie.
# 6  
Old 10-26-2015
That depends on the stand-alone VBA script which we haven't seen. If it takes parameters in a sane manner maybe it can, if it can't it can't.
# 7  
Old 10-26-2015
I will post the vba tomorrow. Basically, when the worksheet is opened a prompt asking for new data is displayed. The user loads the file and clicks a button that does a few things and saves a new file. Hopefully, the VB can be called by bash, but we will see. Thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Using BATCH to call a BASH script on CygWin

I am trying to use a batch file to automatically execute a bash script with no luck this far. The batch script looks like this: C:\Cygwin64\bin\bash test.sh I have also tried this: C:\Cygwin64\bin\bash "C:\Cygwin64\bin\test.sh" Needless to say that the windows box has Cygwin... (7 Replies)
Discussion started by: Xterra
7 Replies

2. Shell Programming and Scripting

How to call a bash script with positional parameters?

Hi, I have a script which will be executed using the below command, bin/nutch crawl urls -dir /data/test/ bin/nutch - Script file crawl, urls, /data/test/ - Parameters -dir - Option The above script should executed from a shell script named test.sh. I have the below code to execute... (2 Replies)
Discussion started by: vel4ever
2 Replies

3. Shell Programming and Scripting

[solved] using backticks to call bash from perl

Hi all, Here is my code: my $x = `bash -c \" ls -l filename | awk '{print \$5}'\"`; print "$x\n"; This will run the first part of the bash script but not the awk command. It therefore gives output of: -rw-r--r-- 1 root root 13619200 2012-04-25 08:16 filename I am actually trying to... (0 Replies)
Discussion started by: free2rhyme2k
0 Replies

4. Shell Programming and Scripting

How to call a bash command from within a perl script?

In a bash script, one can call a perl command in the following manner, where "myperlcommand" is a perl command. perl -e 'myperlcommand(arguments)' perl -e 'print("UUUU"x4)' Now, how can one call a bash command from within a perl script? (Suppose that mybashcommand is a bash... (1 Reply)
Discussion started by: LessNux
1 Replies

5. Shell Programming and Scripting

How to call multiple variables in bash !!

Hi all , I have a file with below data , bash#cat file.txt user1 amount1 status1 user2 amount2 status2 user3 amount3 status3 user4 amount4 status4 . . . Now i have a command to be executed with above values like below , ./errorcheck -u user1 -a amount1 -s status1 ... (3 Replies)
Discussion started by: gnanasekar_beem
3 Replies

6. Shell Programming and Scripting

error when call function in bash script

Dear all, Could you please advice as I when call function i found the following error " refills: command not found" note that refills is function name. following also the function and how i call it function refills { echo "formatting refills and telepin" >> $log awk -F,... (20 Replies)
Discussion started by: ahmed.gad
20 Replies

7. Shell Programming and Scripting

how to call a bash script using perl

Hi I m new to perl. I m trying to write a perl script that calls a bash script; does anyone have a script already that they can provide or help me out? Thanks a lot. (2 Replies)
Discussion started by: adnan786
2 Replies

8. Shell Programming and Scripting

Bash: how to call function having it's name in variable?

Hello. Looking for a method of modularizing my bash script, I am stuck with such a problem. For example, I have: MODULE_NAME="test" FUNCTION_NAME="run" How do I can a function with name test_run? (4 Replies)
Discussion started by: FractalizeR
4 Replies
Login or Register to Ask a Question