View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MP[_3_] MP[_3_] is offline
external usenet poster
 
Posts: 19
Default ActiveWorksheet vs Worksheets.Item(1)

Thanks Peter and JE
Good points and infomation...

"Peter T" <peter_t@discussions wrote in message
...
Seeing JE McGimpsey's response makes me realize I didn't fully digest your
question, in particular that you want to reference the first worksheet
irrespective as to which is the Activsheet. Your code was right first
time,
stick with -

Set oWs = oWb.Worksheets.Item(1)


Guess I'll stick with this to avoid possibility someone saved template with
different sheet active...
Thanks for the pointer

or
Set oWs = oWb.Worksheets(1)


I always try to avoid default properties...lots of experts advise against
that on vb groups...in case of future revisions to object model I
suppose(however unlikely that might be)
:-)


and for future refernce keep in mind your 'ActiveWorkSheet' should have
read
ActiveSheet


Yeah! Duh! :-)


Regards,
Peter T