Declaring an object several times

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hy group

I've an object witch has to change during the procedure.
First I set the object oDataSheet to the following:

Set oDataSheet = shpGraphMagA.Application.DataSheet

later in the procedure, I want to set oDataSheet to another but it's not
working. I just tried like:

Set oDataSheet = shpGraphMagV.Application.DataSheet

(Note shpGraphMagA & shpGraphMagV are 2 graphs in PowerPoint, they are also
declared as object).

Perhaps I've to close first the oDataSheet, but I don't know how. I've tried
with oDataSheet.Close but offcourse it's not working...

Any solutions?

Thanks
 
Ok, Meanwhile I've found that before re-declaring the object, I've to set the
object to Nothing:
Set oDataSheet = Nothing

Then I can declare the object to antother without any errormessages. But
when using the new object, it generates an error "Element not found in this
collection".

I tried to declare the object the same like the first time, but the message
still exsist. So after I've set the object to nothing, I can't use it any more

thanxs
 
Ok, I'm realy helping myself here. I found the solution, like always it was
something stupid, I forgot to reset a counter....
 
Sven said:
Ok, I'm realy helping myself here. I found the solution, like always it was
something stupid, I forgot to reset a counter....


Well, I glad you worked it all out, but I did want to
mention that you've been posting your questions to an Access
database newsgroup where the PowerPoint expertise is no
where near what you would find at a newsroup for the product
you're using (even if you are using Automation from
Access??).
 
Back
Top