Reputation: 323
I am not really sure if this is possible but here it goes , I have written an excel macro and i am calling this macro through a vbs. Here is the snippet for the same.
Dim objExcel, objWorkbook, ad, FilePath
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
For Each ad In objExcel.AddIns
If ad.Name = "hello.xla" Then
FilePath = ad.Path & "\hello.xla"
Exit For
End If
Next
objExcel.Workbooks.Open (FilePath)
Set objWorkbook = objExcel.Workbooks.Open(WScript.Arguments(0))
objExcel.Run "Test"
objWorkbook.Close
objExcel.Quit
Set objWorkbook = Nothing
Set objExcel = Nothing
WScript.Echo "Finished."
WScript.Quit
I am able to do dis. Now i am calling this vb script using java Runtime.getRuntime().exec("cmd /c start calling.vbs");
So is it possible to run this excel macro on a linux server? I understand that we cannot call a vbs file on a linux box and also that opening and formatting the excel maybe not possible hence is there maybe a workaround or some other way to call it in linux machine maybe using an sh file ?
Upvotes: 0
Views: 1961
Reputation: 77454
In theory, you could install Excel and Visual Basic in wine
and see if your macro runs there. You could then try to execute Runtime.getRuntime().exec("wine cmd /c start calling.vbs");
In reality, this sounds like a very complex way of shooting yourself into the foot badly.
If you want it to run reliably on Linux, stay away from Excel and Visual Basic and start using server technology instead of old office technology.
Upvotes: 1