Link to home
Start Free TrialLog in
Avatar of fjsen
fjsen

asked on

Saving custom data in excel

Hello:

   I need to write custom data in an excel workbook. I think the best option is to save them in the CustomProperties collection. Is this OK?

   I need to use excel from a VC++ 6.0 application.

   These are my questions:

   1- I get a compiler error when trying to access to "Type" property of a "Office::DocumentPropertyPtr" pointer. I'm using the following lines to use Excel automation in StdAfx.h:

#import "MSO9.DLL"
#import "VBE6EXT.OLB"
#import "EXCEL9.OLB" \
          rename("DialogBox","_DialogBox") \
          rename("RGB","_RGB") \
          exclude("IFont","IPicture")

I've solved that compiler error renaming the line

#pragma implementation_key(684)
inline enum MsoDocProperties Office::DocumentProperty::GetType ( long lcid ) {
    enum MsoDocProperties _result;
    HRESULT _hr = get_Type(lcid, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

to

#pragma implementation_key(684)
inline enum Office::MsoDocProperties Office::DocumentProperty::GetType ( long lcid ) {
    enum MsoDocProperties _result;
    HRESULT _hr = get_Type(lcid, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

in MSO9.tli. How can I avoid this manual renaming operation?


   2- When I acces to the Custom document properties with this code:
Office::DocumentPropertiesPtr pProps= pWorkbook->CustomDocumentProperties;

   I get a null pointer. How can I access to the custom properties of the workbook?

   Thanks in advance,

Jose.
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Jose,

any luck with the info out those links?, please give some feedback or we can try something else

like installing VC++ here ;)

Brian
Avatar of fjsen
fjsen

ASKER

Does anybody know the answer to the second question?

   Thanks in advance,

Jose.
Hello fjsen

this question is open for more then 2 months
time to clean up
if not stated otherwise

my recom will be
-PAQ and refund
-this will be finalized by an EE Moderator
-with no further update (11.09.2002)

PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER

HAGD:O)Bruintje
posted by ToolzEE v1.0