View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default Unable to loop on Excel collections. Error 451.

Sheets is a collection for sure but it includes all types of sheets (Chart
sheets, dialog sheets,..).

It may not help but if you want to get just worksheets you should user the
Worksheets collection.

--
Jim
"oliviers" wrote in message
...
| Hi,
|
| I encountered a strange issue on one of my customers's laptop.
| My app (vb6) is working with Excel and is crashing on lines of code
| like :
|
| For each objSheet in MyWorkbook.Sheets
|
| I tried 2 cases, when objSheet is defined as object or as worksheet,
| it generates the error "Runtime error '451':
| Property let procedure not defined and property get procedure did not
| return an object".
|
| I guess the sheets object is not considered as a collection and I'm
| wondering why because my app is just working fine for any other user.
| Some library corruption?
|
| Thanks,
|
| Olivier