Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Custom Document Property to identify xls files not yet process
I have a macro that goes through each spreadsheet in a folder and formats the
sheet. I'd like to have the code first check to see if there is a Custom Document Property and if so if it is set to True (this will tell the macro to close the file and move to the next one - the current one has already been formatted). If it doesn't find the property (or if the property is set to false) it would format the file, then add the property (or set it to true). Can this be done via VB? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Custom Document Property to identify xls files not yet process
See:
http://www.cpearson.com/excel/docprop.htm -- Gary''s Student - gsnu200747 "Robert_L_Ross" wrote: I have a macro that goes through each spreadsheet in a folder and formats the sheet. I'd like to have the code first check to see if there is a Custom Document Property and if so if it is set to True (this will tell the macro to close the file and move to the next one - the current one has already been formatted). If it doesn't find the property (or if the property is set to false) it would format the file, then add the property (or set it to true). Can this be done via VB? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Custom Document Property to identify xls files not yet process
On Sep 27, 3:16 pm, Robert_L_Ross
wrote: I have a macro that goes through each spreadsheet in a folder and formats the sheet. I'd like to have the code first check to see if there is a Custom Document Property and if so if it is set to True (this will tell the macro to close the file and move to the next one - the current one has already been formatted). If it doesn't find the property (or if the property is set to false) it would format the file, then add the property (or set it to true). Can this be done via VB? Thanks! Hello Robert, Yes, it can. To check if the Workbook has any custom properties use this code... Cnt = ThisWorkbook.CustomDocumentProperties If the Cnt = 0 then there are no Custom Document Properties. To set a Custom Document Property use this code... Sub AddCustomProperty() Dim CustomProp As Object Set CustomProp = ThisWorkbook.CustomDocumentProperties With CustomProp .Add Name:="User Name", LinkToContent:=False, Type:=msoPropertyTypeString, Value:="Leith Ross" End With End Sub Other TYPE constants a msoPropertyTypeBoolean, msoPropertyTypeDate, msoPropertyTypeFloat, msoPropertyTypeNumber, or msoPropertyTypeString. Sincerely, Leith Ross |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to default WritePassword under excel workbook property for any files as long as those files are the offsprings of the parent file | Excel Programming | |||
Putting the document number custom property in workbook | Excel Programming | |||
Can you link a custom property to an Excel custom header text? | Setting up and Configuration of Excel | |||
Process excel files, suppress alerts | Excel Programming | |||
Identify Document Being opened from an Add-In using Auto_Open? | Excel Programming |