ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create a new property for the current workbook. (https://www.excelbanter.com/excel-programming/289509-create-new-property-current-workbook.html)

Julian Milano[_2_]

Create a new property for the current workbook.
 
Is it possible to create a new property variable for a workbook while
running a macro in it?

I want something like "ThisWorkbook.MyCustomProperty = "Julian"

--

Julian Milano




Chip Pearson

Create a new property for the current workbook.
 
Julian,

Try something like the following:


Dim DocProps As DocumentProperties
Set DocProps = ThisWorkbook.CustomDocumentProperties
DocProps.Add Name:="NewProp", LinkToContent:=False, _
Type:=msoPropertyTypeString, Value:="New Value"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Julian Milano" wrote in message
...
Is it possible to create a new property variable for a workbook

while
running a macro in it?

I want something like "ThisWorkbook.MyCustomProperty = "Julian"

--

Julian Milano






Julian Milano[_2_]

Create a new property for the current workbook.
 
Thanks Chip.

--

Julian Milano


"Chip Pearson" wrote in message
...
Julian,

Try something like the following:


Dim DocProps As DocumentProperties
Set DocProps = ThisWorkbook.CustomDocumentProperties
DocProps.Add Name:="NewProp", LinkToContent:=False, _
Type:=msoPropertyTypeString, Value:="New Value"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Julian Milano" wrote in message
...
Is it possible to create a new property variable for a workbook

while
running a macro in it?

I want something like "ThisWorkbook.MyCustomProperty = "Julian"

--

Julian Milano









All times are GMT +1. The time now is 09:36 PM.

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