Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Create own properties?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Create own properties?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add properties to add-in ? Marc Hillman Excel Programming 7 November 26th 08 12:32 PM
using properties Mrs. Smith Excel Discussion (Misc queries) 1 June 4th 07 05:37 PM
Tab Properties JohnHill Excel Worksheet Functions 2 August 12th 05 04:38 AM
Properties transferring from excel cells to word file properties lubo Excel Programming 4 July 12th 05 11:24 AM
Properties of a jpg Michael Singmin Excel Programming 3 June 11th 05 11:45 AM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"