Hello,
I have a macro that does plotting on a group of files. But if the file has a particular word "[VERISION]" I need to skip it. I wrote the following that is within a loop for the files:
If I only do one file this works. One I select multiple files I get the following error dialog box:
Run-time error '91':
Object variable or with block variable not set
Not sure what I am doing wrong.
Thanks for the help in advance.
Michael Virostko
I have a macro that does plotting on a group of files. But if the file has a particular word "[VERISION]" I need to skip it. I wrote the following that is within a loop for the files:
Code:
ActiveSheet.Cells(1, 1).Select
On Error GoTo GoodFile:
Cells.Find(What:="[VERSION]", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
BadFile:
itmp = MsgBox("File -" & FileName & "is Version 2" & Chr$(13) & " and cannot plot.", vbOKOnly, "Incorrect file type")
GoTo FileEnd:
If I only do one file this works. One I select multiple files I get the following error dialog box:
Run-time error '91':
Object variable or with block variable not set
Not sure what I am doing wrong.
Thanks for the help in advance.
Michael Virostko