View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default how to get the value object back from 'customproperties'?

I don't think you can. An object is a pointer to memory where data is
stored. When you exit out of excel you loose the memory. To save the data
you will need to save the memory area to a file. When you open excel you
would need to allocate memory for the object and then read the data from the
file into the memory area.

If you had a compiled version of Visual Basic you could save the object as
part of the executable file. Then the object would be retained when you ran
the executable.

"NA_AB" wrote:

hi all, am developing an automation addin for excel. And, while saving my
worksheet I am saving certain objects as the custom properties of that
worksheet. Now when am trying to get back those objects, I am getting an
exception that says 'Unable to cast type System.string to....'. What is the
problem here? How can I extract the values(stored as custom properties) as
Objects but not strings?!

Regards,
na_ab