View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken McLennan[_3_] Ken McLennan[_3_] is offline
external usenet poster
 
Posts: 90
Default Refreshing Object Properties after "Set"

G'day there Tom,

Set gRng = Nothing
On error Resume Next
Set gRng = dSht.Range("wrkRanks")
On Error goto 0


Of course!! That makes sense. I've used the "on error" construct
elsewhere, but I thought that using it here would just translate the
same error to another location.

Then when using gRng

if not gRng is nothing then

- code to use gRng
End if


I had used the "if not" line with the above "Set" command, but
without success. This way looks much more logical.

gRnd doesn't refer to the named range wrkRanks.


Well, there was my first mistake =)

It refers to the range
defined by wrkRanks when you set the variable.


That was my second, and was what I learned from those mistakes. So
it wasn't a totally wasted experience.

The only way to refresh that
range as you call it is to set it again or instead of using a variable, use
dSht.Range("wrkRanks") directly.


OK, I can see the mechanism behind it all. Unfortunately,
"Set"ting it again or using the direct approach introduces other
problems that I'd rather not try to deal with at the moment. (Translate
that to mean, "I've not figured out how to do it". I'll stick with your
"On error" & "if not" techniques and exit the subs as necessary.

Thanks very much for your assistance, and explanation, Tom. I
really do appreciate the effort you put in to helping me learn.

See ya
--
Ken McLennan
Qld, Australia