Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Summary Error? | Excel Worksheet Functions | |||
multi group with summary above with 1 overall summary line below | Excel Discussion (Misc queries) | |||
Properties transferring from excel cells to word file properties | Excel Programming | |||
Automation Error(-2147467259) in Properties Collection | Excel Programming | |||
Automation Error(-2147467259) in Properties Collection | Excel Programming |