Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default DSO Summary Properties Error

I use a small chunk of VBA to allow me to edit summary properties via
an Excel sheet. Basically, one macro retrieves a list of file names
from a folder, then list those names and various properties in a sheet
(properties include Title, Author, Subject, Category, etc.)

I have a second macro that changes the values of those properties if
they've been edited in the Excel file. Occasionally, I run into a
permission error when trying to update certain properties. It seems to
be localized to situations where the property's previous value was null
and I'm trying to change that value. If I use Windows Explorer to
change the value and then try to edit via my macro, it will work fine.

For some fields, like Title, I can remove a value and then use the
macro to add one without a problem. With other fields, like Category,
I'll get the error anytime I try to update it from null to something.

Any guidance would be appreciated. I've searched high and low and
can't seem to figure out what is happening.

- John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default DSO Summary Properties Error

Still having problems but here's a little more information. I've only
been able to create the problem on DOC files, XLS seem to update fine.
Also, I can update most properties but receive the permission denied
error if attempting to update Category, Manager or Company. I have two
sample Word DOCs created by right-clicking in Windows Explorer. No data
inside the files. One creates there errors. The other doesn't. I've
tried closing Windows Explorer to ensure that nothing is trying to
access the file. In addition, I've commented out the props mentioned
above and the code works fine...every time.

Any help would be appreciated.

Here's my code. It crashes at the .Category

Sub TestDSO()

Dim DSO As DSOFile.OleDocumentProperties
Set DSO = New DSOFile.OleDocumentProperties
strFile = "C:\Documents and Settings\mic06\My
Documents\TestFolder\Test1\ProblemFile.doc"
DSO.Open sfilename:=strFile

With DSO.SummaryProperties
.Title = "This is the Title"
.Subject = "This is the Subject"
.Category = "This is the Category"
End With

DSO.Save
DSO.Close
End Sub

On Dec 20, 1:02 pm, "John Michl" wrote:
I use a small chunk of VBA to allow me to edit summary properties via
an Excel sheet. Basically, one macro retrieves a list of file names
from a folder, then list those names and various properties in a sheet
(properties include Title, Author, Subject, Category, etc.)

I have a second macro that changes the values of those properties if
they've been edited in the Excel file. Occasionally, I run into a
permission error when trying to update certain properties. It seems to
be localized to situations where the property's previous value was null
and I'm trying to change that value. If I use Windows Explorer to
change the value and then try to edit via my macro, it will work fine.

For some fields, like Title, I can remove a value and then use the
macro to add one without a problem. With other fields, like Category,
I'll get the error anytime I try to update it from null to something.

Any guidance would be appreciated. I've searched high and low and
can't seem to figure out what is happening.

- John


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Summary Error? Brad Autry Excel Worksheet Functions 6 December 8th 09 05:15 PM
multi group with summary above with 1 overall summary line below Freddy Excel Discussion (Misc queries) 1 November 1st 05 08:50 PM
Properties transferring from excel cells to word file properties lubo Excel Programming 4 July 12th 05 11:24 AM
Automation Error(-2147467259) in Properties Collection Bob Phillips[_6_] Excel Programming 1 April 14th 05 07:08 PM
Automation Error(-2147467259) in Properties Collection Bob Phillips[_6_] Excel Programming 0 April 14th 05 04:27 PM


All times are GMT +1. The time now is 12:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"