Free for PREMIUM members
Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
Option Explicit On
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mybook As Microsoft.Office.Interop.Excel.Workbook
Dim xlApp As Microsoft.Office.Interop.Excel.Application
' Error trapping
On Error GoTo errTrap
' Quit if no file was specified
If Command() = "" Then Exit Sub
' Open excel document
xlApp = New Microsoft.Office.Interop.Excel.Application
mybook = xlApp.Workbooks.Open(Command, , , , , "")
' Close excel
MsgBox(Err.Description, vbInformation, "Excel document printing")
Open in new window
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $159.20.
Premium members get this course for $151.20.
Premium members get this course for $25.00.
Premium members get this course for $329.00.
Premium members get this course for $168.80.
Premium members get this course for $49.99.