I am trying to print a specific sheet, and when I go to Print it prints the entire workbook. How do I print only the sheet. Here is my code.
strExcelFile = "c:\Sheets.xls"
Set xlobj = CreateObject("excel.application"
With xlobj
.Visible = True
.Workbooks.Open Filename:=strExcelFile
CatCutSheet = Rs1!CutSheet
Set Sheet = .Worksheets(CatCutSheet)
With Sheet
.Cells(5, 3).Value = Rs1!P
.Cells(7, 1).Value = Rs1!Q
End With
.ActiveWorkbook.PrintOut
.ActiveWorkbook.Close SaveChanges:=False
End With
xlobj.Application.Quit
Set xlobj = Nothing
Bill
strExcelFile = "c:\Sheets.xls"
Set xlobj = CreateObject("excel.application"

With xlobj
.Visible = True
.Workbooks.Open Filename:=strExcelFile
CatCutSheet = Rs1!CutSheet
Set Sheet = .Worksheets(CatCutSheet)
With Sheet
.Cells(5, 3).Value = Rs1!P
.Cells(7, 1).Value = Rs1!Q
End With
.ActiveWorkbook.PrintOut
.ActiveWorkbook.Close SaveChanges:=False
End With
xlobj.Application.Quit
Set xlobj = Nothing
Bill