0

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 ?

4
  • See this stackoverflow.com/questions/864116/… and this user.services.openoffice.org/en/forum/… Commented May 17, 2012 at 11:31
  • so i tink wat i conculde from dese links are that this is not possible . Right ? maybe changing it to pearl might help but callin the excel macros are not possible Commented May 17, 2012 at 11:44
  • My expertise doesn't include Linux but from those links that's what it seems like it :( Maybe you would like to wait for some linux expert to confirm the same? Commented May 17, 2012 at 11:47
  • yes just hoping against odds now that this may somehow be possible Commented May 17, 2012 at 11:56

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.