ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating Document property values using macro (https://www.excelbanter.com/excel-programming/375829-populating-document-property-values-using-macro.html)

Mike DeWinter

Populating Document property values using macro
 
Hello everyone,

I have a question which has been giving me quite a bit of trouble this
morning. First off I need to populate the "metadata" (document properties)
for several workbooks and decided that a macro would be the best approach
considering we already have one for editing and formating data from other
workbooks into a new one(this is the one that needs the "metadata"). My code
is as follows:

Sub T00()
' StatSumm Macro

ChDir "file path"

Workbooks.Open Filename:="file path", UpdateLinks:=0

Range("A1:J65").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Range("K:M").Delete

Range("A1").Select
ActiveWorkbook.Title = "Blah"
ActiveWorkbook.(insert others as needed) = "blah blah blah"
ActiveWorkbook.SaveAs Filename:="file path", FileFormat:=xlNormal

ActiveWorkbook.PublishObjects.Add(xlSourcePrintAre a, _
"\\S90x02\res\BULLETIN\FY06\Bull0605\Web\t00.h tm", "summary", "", _
xlHtmlStatic, "t00", "").Publish (True)

Workbooks("t00.xls").Close SaveChanges:=False


End Sub

The problem I have is that my method for populating those values doesn't
work for Company or Category can some one please help?

Mike DeWinter




Tom Ogilvy

Populating Document property values using macro
 
only two or three can be set with that approach. For the others you need:

http://www.cpearson.com/excel/docprop.htm

--
Regards,
Tom Ogilvy


"Mike DeWinter" <Mike wrote in message
...
Hello everyone,

I have a question which has been giving me quite a bit of trouble this
morning. First off I need to populate the "metadata" (document
properties)
for several workbooks and decided that a macro would be the best approach
considering we already have one for editing and formating data from other
workbooks into a new one(this is the one that needs the "metadata"). My
code
is as follows:

Sub T00()
' StatSumm Macro

ChDir "file path"

Workbooks.Open Filename:="file path", UpdateLinks:=0

Range("A1:J65").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Range("K:M").Delete

Range("A1").Select
ActiveWorkbook.Title = "Blah"
ActiveWorkbook.(insert others as needed) = "blah blah blah"
ActiveWorkbook.SaveAs Filename:="file path", FileFormat:=xlNormal

ActiveWorkbook.PublishObjects.Add(xlSourcePrintAre a, _
"\\S90x02\res\BULLETIN\FY06\Bull0605\Web\t00.h tm", "summary", "", _
xlHtmlStatic, "t00", "").Publish (True)

Workbooks("t00.xls").Close SaveChanges:=False


End Sub

The problem I have is that my method for populating those values doesn't
work for Company or Category can some one please help?

Mike DeWinter







All times are GMT +1. The time now is 11:30 PM.

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