Sign Up for Training |
Jet Express Support |
Jet Reports Company Site
Jet Reports Financials
Jet Professional
Jet Enterprise
Submit a Request
Give Feedback

Launching Jet Reports from VBA

Note: This information applies to Jet Professional, Jet Essentials, and Jet Reports

If you write macros in Excel or want to launch Jet from another application, you can launch Excel, update report options, refresh the report and print. Below is some sample code that demonstrates how to do this.

Steps implemented in code:

  1. Start Excel; make it visible and interactive.

  2. Open the Jet Add-in.

  3. Open a Workbook.

  4. Update Options.

  5. Run Jet/Report.

  6. Print the Worksheet that contains the report.

  7. Close Excel.

Sub JetUpdate()

Dim XLApp as Object

Set XLApp = New Excel.Application


Workbooks don't necessarily start in a mode that is visible or interactive.

If the user will interact with the workbook, you need to set the following two values:

XLApp.Visible = True

XLApp.Interactive = True


Add-ins do not automatically open when using automation, so the Jet Excel add-in

must be opened manually. You must also open any other add-ins that you need.

XLApp.Application.Workbooks.Open ("C:\program files (x86)\JetReports\jetreports.xlam")


Open the report workbook:

XLApp.Application.Workbooks.Open ("ReportName.xlsx")


Update the report options. The option values are in single cell named ranges.

XLApp.Application.Workbooks("ReportName.xlsx").Names.Item("DateFilter").RefersToRange.Value = _



Run the jet report.


In Jet Professional 2018 (18.0) and higher, the menu option is named RUN

XLApp.Application.Run "JetReports.xlam!JetMenu", "Run"


In earlier versions, the menu option is named REPORT

XLApp.Application.Run "JetReports.xlam!JetMenu", "Report"


In some cases all the below steps may not be desired.

Choose a worksheet and launch print preview. The user can cause the report to print if desired.



Avoid the message asking if the workbook should be saved by marking it as already saved.

Be careful with this. You are assuming that the workbook does not need to be saved since it is a report


XLApp.Application.Workbooks("ReportName.xlsx").Saved = TRUE


Close Excel


End Sub

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request