Option Explicit Private xlApp As Excel.Application Private xlBok As Excel.Workbook Private xlSht As Excel.Worksheet
Private Sub Command1_Click() Set xlApp = CreateObject("Excel.Application") Set xlBok = xlApp.Workbooks.Open("C:\test.xls") Set xlSht = xlBok.Worksheets(1) xlApp.Visible = True xlBok.Activate xlSht.PrintPreview Set xlSht = Nothing xlBok.Close Set xlBok = Nothing xlApp.Quit Set xlApp = Nothing End Sub