Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:51:13+00:00 2026-06-17T18:51:13+00:00

Background There was an old ActiveX control created by VB. I added this ActiveX

  • 0

Background

There was an old ActiveX control created by VB. I added this ActiveX control to my Excel workbook and set some properties. These properties were saved when the book was saved. Specifically, they were saved in UserControl_WriteProperties function using PropertyBag in VB code. So these properties persisted in the workbook until now.

My Task

I have to create a new ActiveX control using C++ to be backward compatible with the old one. I need ALL information persisted in the ActiveX control which is in my old Excel workbook. So, I implement IPersistPropertyBag to my ActiveX control.

My expectation is, when I open my old Excel workbook, all information must be retrieved correctly via PropertyBag.

Problem

I’ve found that the information persisted in my Excel workbook is in Stream format. I can implement IPersistStreamInit to my new ActiveX control but I don’t understand the format in the Stream persisted in my Excel workbook. So, I can’t retrieve the information persisted in my Excel workbook.

I wonder why the information was saved in Stream format even though they were saved via Propertybag in VB code.

Question

Is there a way to get all information persisted in the ActiveX control in this scenario?
I’ve been finding it for two days but I can’t find a way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:51:14+00:00Added an answer on June 17, 2026 at 6:51 pm

    I’ve done this task by creating a VB6 COM dll to handle this task.

    Option Explicit
    Dim objMyPropertyBag As PropertyBag
    
    Public Sub Contents(a_content As Variant)
        objMyPropertyBag.Contents = a_content
    End Sub
    
    Public Function Read(key As String) As String
    On Error GoTo Error_Handler
        Read = objMyPropertyBag.ReadProperty(key)
    Error_Handler:
        MsgBox Err.Source & Err.Number
    End Function
    
    Private Sub Class_Initialize()
        Set objMyPropertyBag = New PropertyBag
    End Sub
    

    When I open the my old Excel workbook which contains an old ActiveX object. I do the following steps:

    1. It will come to IPersistStreamInit::Load function which give me an IStream.
    2. I read this stream and parse to VARIANT of SAFEARRAY of VT_UI1 (equal to array of BYTE) called “content”.
    3. I create an instance of VB6 COM dll, called “contentReader”.
    4. I call contentReader->Contents(content) (pass the SAFEARRAY I’ve created to it).

    Now I can read any key in the PropertyBag via contentReader->Read([in] key, [out] value).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in code behind we set the imagepath of window background ,is there any way
Is there away to set a background image on a webpage when the webpage
Is there any way to set a background view on a UITableViewController? I try
Is there any way to do UITableView background like on this image programmatically? I
Background story: There are these Source and Result interfaces for XML. These are adapters
update: some background - i use the xml file to generate a set of
This is my css for the background, but the thing is that there is
I am using an old CSS trick to get a semi-transparent background for some
starting to work as an IT man lately with some programing background, there are
Background: There are multiple DBPArentProductKEys associated with a POG.ID. I need to count the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.