ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Retrieving custom document properties - Excel 2007 (https://www.excelbanter.com/excel-programming/415322-retrieving-custom-document-properties-excel-2007-a.html)

Barb Reinhardt

Retrieving custom document properties - Excel 2007
 

--
HTH,
Barb Reinhardt


Barb Reinhardt

Retrieving custom document properties - Excel 2007
 
Here's the rest of my message.

I've used VBA in Excel 2003 to retrieve Custom document properties and it
works well. However, when I'm testing my file in 2007, it gets held up here

Set objDocProperties = CreateObject("DSOFile.OleDocumentProperties")

I've got the reference set for DSO OLE Document Properties reader 2.1
within the VBE

In this KB article ( http://support.microsoft.com/kb/224351 ) it states
that it should work if I have the compatibility pack installed. Every time I
open EXcel 2007 it shows COMPATIBILITY mode at the top, so I have to assume
it's there.

Can someone assist? I use this macro once a month to pull data for an
operations review and there is no way I can go back to doing it manually.

Thanks,

Barb Reinhardt



Jim Rech

Retrieving custom document properties - Excel 2007
 
Every time I open EXcel 2007 it shows COMPATIBILITY mode at the top, so I
have to assume it's there.


Compatibility mode is different that the Compatibility Pack. If you have
the later installed you can open Excel 2007 files (XLSX, etc.) in Excel
2003. If in doubt try to install it again.

--
Jim
"Barb Reinhardt" wrote in message
...
| Here's the rest of my message.
|
| I've used VBA in Excel 2003 to retrieve Custom document properties and it
| works well. However, when I'm testing my file in 2007, it gets held up
here
|
| Set objDocProperties = CreateObject("DSOFile.OleDocumentProperties")
|
| I've got the reference set for DSO OLE Document Properties reader 2.1
| within the VBE
|
| In this KB article ( http://support.microsoft.com/kb/224351 ) it states
| that it should work if I have the compatibility pack installed. Every
time I
| open EXcel 2007 it shows COMPATIBILITY mode at the top, so I have to
assume
| it's there.
|
| Can someone assist? I use this macro once a month to pull data for an
| operations review and there is no way I can go back to doing it manually.
|
| Thanks,
|
| Barb Reinhardt
|
|



Barb Reinhardt

Retrieving custom document properties - Excel 2007
 
I get Runtime error 429. ActiveX component can't create object

Barb Reinhardt



"Chip Pearson" wrote:

The following works for me. If you have a reference set to the DSO 2.1
library, you can explicitly declare the variable rather than using
CreateObject.

Dim DSO As DSOFile.OleDocumentProperties
Set DSO = New DSOFile.OleDocumentProperties
DSO.Open "C:\Books.xls"
Debug.Print DSO.CustomProperties("TestProp")
Debug.Print DSO.SummaryProperties.Author
DSO.Close

With CreateObject, use

Dim DSO As Object
Set DSO = CreateObject("DSOFile.OleDocumentProperties")
DSO.Open "C:\Books.xls"
Debug.Print DSO.CustomProperties("TestProp")
Debug.Print DSO.SummaryProperties.Author
DSO.Close

What error do you get (or do you just get no property values) when you run
the code in 2007?


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)





"Barb Reinhardt" wrote in message
...
Here's the rest of my message.

I've used VBA in Excel 2003 to retrieve Custom document properties and it
works well. However, when I'm testing my file in 2007, it gets held up
here

Set objDocProperties = CreateObject("DSOFile.OleDocumentProperties")

I've got the reference set for DSO OLE Document Properties reader 2.1
within the VBE

In this KB article ( http://support.microsoft.com/kb/224351 ) it states
that it should work if I have the compatibility pack installed. Every
time I
open EXcel 2007 it shows COMPATIBILITY mode at the top, so I have to
assume
it's there.

Can someone assist? I use this macro once a month to pull data for an
operations review and there is no way I can go back to doing it manually.

Thanks,

Barb Reinhardt





All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com