Hi all,
I am trying to manipulate an Excel spreadsheet. I want to search the A column for a string from a text box of vb6 then display it. I can't get it to work in my VB6 app. What am I doing wrong ?
Dim mailmwo As Excel.Application
Dim mwoBook As Excel.Workbook
mwonum = txtScan
Set mailmwo = New Excel.Application
mailmwo.Workbooks.Open "C:\mailmwo\mailmwo.xls", , , , "password", "password"
mailmwo.Sheets("MWOs - Do Not Sort!").Select
mailmwo.Range("A2").Select
mailmwo.Selection.Find(What:=mwonum), After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ ' <- line generated by Excel macro record
The error is :
'' gives runtime error '91' : Object variable or With block variable not set