Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Saving custom data in excel

Posted on 2002-06-17
5
Medium Priority
?
286 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:fjsen
  • 4
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 600 total points
ID: 7083361
Hi fjsen,

Got no VC++ here but these articles can maybe shed some light on your problem

reading the custom properties of office documents
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q186898

and this article will give some idea how to edit them in vb
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q224351

it uses the dso.dll activex component to do that

and this one shows how to use automation to read/write doc props from VC++
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q238393

HAGD:O)Bruintje
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7090701
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
0
 

Author Comment

by:fjsen
ID: 7095413
Does anybody know the answer to the second question?

   Thanks in advance,

Jose.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7249995
better put a link to this in the C++ section

http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/

:O)Bruintje
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7262015
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
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question