Link to home
Start Free TrialLog in
Avatar of CalmSoul
CalmSoulFlag for United States of America

asked on

Save file as pdf

How can I execute following VBA using java?

Sub Macro2()

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "C:\Documents and Settings\hjanjua\My Documents\Book1.pdf", Quality:= _
        xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
        OpenAfterPublish:=False
End Sub

Please supply java code ...

Regards,
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You can invoke a VB intepreter on a script file containing that using Runtime.exec:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
lots of tools available that allow you to call activex/vb, see here for a summary

http://staff.develop.com/halloway/JavaWin32.html

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial