I am using VB6 to automate Word (2000).
Basically, the app opens up a WORD.doc and searches to see if a certain colour exists.
This had been working fine for a while, but now returns Object variable or With block variable not set (Error 91).
However, I have not amended the code anywhere regarding this and I have checked that my references are valid.
The line of code it is erroring out on is:
SearchColour is a valid long value.
When I look at the Watch Window, objWord.Selection.Find returns appears to be a valid reference (even though the value is blank).
objWord.Selection.Find.Font returns Nothing.
Fortunately, I had been testing this on 2 separate machines and get the same problem on both machines now.
Even with previous backups (going back several revisions) do not work when they did at the time.
I cannot find a commonality to the same problem occurring on 2 separate machines. They had separate code and their own documents.
After a couple of attempts at trying to use the Watch Window, Windows will shut down VB
**********************************
There is more than one way to skin a cat...but who wants a skinned cat?
Basically, the app opens up a WORD.doc and searches to see if a certain colour exists.
This had been working fine for a while, but now returns Object variable or With block variable not set (Error 91).
However, I have not amended the code anywhere regarding this and I have checked that my references are valid.
The line of code it is erroring out on is:
Code:
objWord.Selection.Find.Font.Color = SearchColour
SearchColour is a valid long value.
When I look at the Watch Window, objWord.Selection.Find returns appears to be a valid reference (even though the value is blank).
objWord.Selection.Find.Font returns Nothing.
Fortunately, I had been testing this on 2 separate machines and get the same problem on both machines now.
Even with previous backups (going back several revisions) do not work when they did at the time.
I cannot find a commonality to the same problem occurring on 2 separate machines. They had separate code and their own documents.
After a couple of attempts at trying to use the Watch Window, Windows will shut down VB
**********************************
There is more than one way to skin a cat...but who wants a skinned cat?