Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default how to declare a class module

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default how to declare a class module

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
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
Creating UDF by Class Module (Leo)? Leo Excel Discussion (Misc queries) 1 December 2nd 08 10:59 AM
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
Chart Class Module/follow on question to hyperlink post earlier. Rominall Charts and Charting in Excel 2 March 7th 07 02:43 AM
Need some comments on my Utility_Move class module. jchen Excel Worksheet Functions 0 August 21st 06 07:05 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM


All times are GMT +1. The time now is 06:42 AM.

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"