Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've been programming in VB6 for a while but it seems that
how you declare the properties, methods, and events of a class module in Excel VBA is different. I've declared several public properties in a a class module. Now I want to set these properties from a form module. What am I doing wrong? Code excerpt from Class Module (PGDSettings): 'LEIS User Name Start - Public Public Property Get LEISUserName() As String LEISUserName = GetSetting (App.ProductName, "Settings", "LEISUUID") End Property Public Property Let LEISUserName(strLEISUserName As String) SaveSetting App.ProductName, "Settings", "LEISUUID", strLEISUserName End Property 'LEIS User Name End Code excerpt from Form Module: Option Explicit Public ps As New PGDSettings Private Sub UserForm_Activate() txtUuid.Text = ps.LEISUserName End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Scratch it. I figured out what was wrong. I was using
the app.productname which works in VB6 but not in Excel VBA. Replaced it and it works fine. Sorry to have bugged anyone. -Kevin -----Original Message----- I've been programming in VB6 for a while but it seems that how you declare the properties, methods, and events of a class module in Excel VBA is different. I've declared several public properties in a a class module. Now I want to set these properties from a form module. What am I doing wrong? Code excerpt from Class Module (PGDSettings): 'LEIS User Name Start - Public Public Property Get LEISUserName() As String LEISUserName = GetSetting (App.ProductName, "Settings", "LEISUUID") End Property Public Property Let LEISUserName(strLEISUserName As String) SaveSetting App.ProductName, "Settings", "LEISUUID", strLEISUserName End Property 'LEIS User Name End Code excerpt from Form Module: Option Explicit Public ps As New PGDSettings Private Sub UserForm_Activate() txtUuid.Text = ps.LEISUserName End Sub . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating UDF by Class Module (Leo)? | Excel Discussion (Misc queries) | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Chart Class Module/follow on question to hyperlink post earlier. | Charts and Charting in Excel | |||
Need some comments on my Utility_Move class module. | Excel Worksheet Functions | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) |