Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to create ones own property to an Excel object?
Example: The workbook has some builtin properties, like... ThisWorkbook.Path ThisWorkbook.Name etc... I would like to create a... ThisWorkbook.URL ....which, obvious, would return the URL from where on the Intranet (or Internet :-) the user can always find the newest version of the workbook, and also use this new property, in my own macros, for further programming, like data links in the workbooks URL path. I'm aware that it would probably require some sort of programming in the Workbook_Open event, but that doesn't matter - just as long as I have the property for the rest of the time that the workbook is open. Possible? TIA, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes. Eg: enter this in the "ThisWorkbook" module in the VBE:
Property Get URL() As String URL = "http://www.google.com" End Property Tim "Charlotte E" <@ wrote in message ... Is it possible to create ones own property to an Excel object? Example: The workbook has some builtin properties, like... ThisWorkbook.Path ThisWorkbook.Name etc... I would like to create a... ThisWorkbook.URL ...which, obvious, would return the URL from where on the Intranet (or Internet :-) the user can always find the newest version of the workbook, and also use this new property, in my own macros, for further programming, like data links in the workbooks URL path. I'm aware that it would probably require some sort of programming in the Workbook_Open event, but that doesn't matter - just as long as I have the property for the rest of the time that the workbook is open. Possible? TIA, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Awesome :-)
Thanks, Tim :-) Tim Williams wrote: Yes. Eg: enter this in the "ThisWorkbook" module in the VBE: Property Get URL() As String URL = "http://www.google.com" End Property Tim "Charlotte E" <@ wrote in message ... Is it possible to create ones own property to an Excel object? Example: The workbook has some builtin properties, like... ThisWorkbook.Path ThisWorkbook.Name etc... I would like to create a... ThisWorkbook.URL ...which, obvious, would return the URL from where on the Intranet (or Internet :-) the user can always find the newest version of the workbook, and also use this new property, in my own macros, for further programming, like data links in the workbooks URL path. I'm aware that it would probably require some sort of programming in the Workbook_Open event, but that doesn't matter - just as long as I have the property for the rest of the time that the workbook is open. Possible? TIA, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes. Eg: enter this in the "ThisWorkbook" module in the VBE:
Property Get URL() As String URL = "http://www.google.com" End Property Is it possible to do the opposite? I.e.: ThisWorkbook.URL = http://www.google.com/ ....so it can be read later with: MsgBox ThisWorkbook.URL ??? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim m_URL as string
Property Let URL(val as String) m_URL = val End Property Property Get URL() as String URL = m_URL End Property Tim "Charlotte E" <@ wrote in message ... Yes. Eg: enter this in the "ThisWorkbook" module in the VBE: Property Get URL() As String URL = "http://www.google.com" End Property Is it possible to do the opposite? I.e.: ThisWorkbook.URL = http://www.google.com/ ...so it can be read later with: MsgBox ThisWorkbook.URL ??? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One letter wrong!!!!
I tried with: Property Set Thanks, Tim :-) Tim Williams wrote: Dim m_URL as string Property Let URL(val as String) m_URL = val End Property Property Get URL() as String URL = m_URL End Property Tim "Charlotte E" <@ wrote in message ... Yes. Eg: enter this in the "ThisWorkbook" module in the VBE: Property Get URL() As String URL = "http://www.google.com" End Property Is it possible to do the opposite? I.e.: ThisWorkbook.URL = http://www.google.com/ ...so it can be read later with: MsgBox ThisWorkbook.URL ??? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
yup. SET is for assigning OBJECTS. easy mistake to make too
"Charlotte E" <@ wrote in message ... One letter wrong!!!! I tried with: Property Set Thanks, Tim :-) Tim Williams wrote: Dim m_URL as string Property Let URL(val as String) m_URL = val End Property Property Get URL() as String URL = m_URL End Property Tim "Charlotte E" <@ wrote in message ... Yes. Eg: enter this in the "ThisWorkbook" module in the VBE: Property Get URL() As String URL = "http://www.google.com" End Property Is it possible to do the opposite? I.e.: ThisWorkbook.URL = http://www.google.com/ ...so it can be read later with: MsgBox ThisWorkbook.URL ??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I add properties to add-in ? | Excel Programming | |||
using properties | Excel Discussion (Misc queries) | |||
Tab Properties | Excel Worksheet Functions | |||
Properties transferring from excel cells to word file properties | Excel Programming | |||
Properties of a jpg | Excel Programming |