2

I need to trigger an excel macro from Java. The function contains arguments to be passed from the Java code like:

Sub Convertfile(String SourceFilePath, String DestFilePath)
{
open html file(SourceFilePath\ABC.html)
save file as (DestFilePath\XYZ.csv)
}

SourceFilePath and DestFilePath are derived in the Java code. So how should I call this function from Java. Please help me on this.

Note: I am using groovy via Jenkins to execute the Java script.

I tried the option mentioned in other post How to call an Excel VBA Macro from Java Code?. It works fine with excel macro which doesn't have any arguments to be passed to its function. In my case, I need to pass 2 arguments [SourceFilePath and DestFilePath] from Java code to the excel macro. Please help me on this. The objective of this macro is to copy the contents of html file to an excel file. Else if there is anyother way to acheive the above item please let me know.

Community
  • 1
  • 1
  • Or is there any way to copy contents of HTML page to Excel sheet... – user6619281 Feb 01 '17 at 10:32
  • 1
    Possible duplicate of [How to call an Excel VBA Macro from Java Code?](http://stackoverflow.com/questions/7789780/how-to-call-an-excel-vba-macro-from-java-code) – ΦXocę 웃 Пepeúpa ツ Feb 01 '17 at 10:36
  • Hi, thank you for the suggestion. I tried the option mentioned in the above post. It works fine with excel macro which doesn't have any arguments to be passed to its function. In my case, I need to pass 2 arguments [SourceFilePath and DestFilePath] from Java code to the excel macro. Please help me on this. The objective of this macro is to copy the contents of html file to an excel file. Else if there is anyother way to acheive the above item please let me know. Thanks. – user6619281 Feb 02 '17 at 05:27
  • hey guys, please help me on this... – user6619281 Feb 06 '17 at 06:24

0 Answers0