Joe O'Connell
joeo at appoli.com
Mon Dec 21 12:21:35 CST 2009
I need to open a specific sheet in an Excel workbook from Access 2000.
There is no problem opening the workbook, the list of processes shows
that Excel is running. The problem is that the workbook is not visible.
The statement to display the workbook ("excelWb.Visible = True") fails
with an error "Object does not support this object or method".
Does anyone know the correct syntax to display the workbook?
The code is:
Public Sub OpenSheet( strWB, strSheet)
Dim excelapp As Excel.Application
Dim excelWb As Excel.Workbook
Dim excelSheet As Excel.Worksheet
Set excelapp = CreateObject("Excel.Application")
Set excelWb = excelapp.Workbooks.Open(strWB, , True)
excelWb.Worksheets(strSheet).Activate
excelWb.Visible = True
End Sub
Joe O'Connell