Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.vb.ole.automation,microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings all,
My VB6 w/OLE Automation works fine until it comes to the last line listed, then burps with a "Runtime Error 91 Object variable or With block variable not set" message Dim xlApp As Excel.Application 'early-binding Dim xlWrkbook As Excel.Workbook Dim xlWrksheets As Excel.Worksheets Dim xlWrksheet As Excel.Worksheet Set xlApp = New Excel.Application '--- open checklist spreadsheet Set xlWrkbook = xlApp.Workbooks.Open("C:\mystuff\mysprdsht.xls") '--- do 4th sheet Set xlWrksheet = xlApp.Worksheets(5) xlWrksheet.Activate Dim cells_found As Range cells_found = xlWrksheet.Cells.Find(What:="foobar") <-- fails here cells_found = xlWrksheet.Cells.Find("foobar") <-- tried thys syntax, also fails What am I doing wrong? TIA, Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
unable to protect cells in macro sheet b/c runtime error 1004 | Excel Worksheet Functions | |||
Runtime Error - Subscript out of range despite On Error statement | Excel Programming | |||
Copy only Visible cells to another sheet in Macro? Runtime 438 error? | Excel Programming | |||
Runtime error 424 object required on Set Statement | Excel Programming | |||
Using Find statement in VBA module causes error 91 | Excel Programming |