View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Joe[_40_] Joe[_40_] is offline
external usenet poster
 
Posts: 2
Default unable to get the Interior property of the range class

In repsonse to George's comments, I added some debug code. Once an OK
button is clicked in the application, the problematic line actually gets
executed several times (4, acutually) before causing an RT error on the
5th time.

I can see nothing in the code that would change state from one time to
the next. What could it be other than the environment? And what in the
environment other than protection? (static_int is a local static
variable. I expected it to increment, so now I have another mystery.)

Set wksht = Worksheets("DataInput")
Set theCell = wksht.Cells(cur_row, ValCol)
If cur_row = 11 And ValCol = 11 Then
static_int = static_int + 1
Debug.Print "Static_int = " & static_int & ", sheet = " &
wksht.name
End If
If theCell.Interior.Pattern = xlGray16 Then...

Debug Output:
Static_int = 1, sheet = DataInput
Static_int = 1, sheet = DataInput
Static_int = 1, sheet = DataInput
Static_int = 1, sheet = DataInput
Static_int = 1, sheet = DataInput
<runtime error "Unable to get the interior property of the Range class"


*** Sent via Developersdex http://www.developersdex.com ***