View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
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
.