I have the following code that runs when the spreadsheet is open.
I have a type mismatch on the date portion when I try to set a default date if there is no data exists in that registry entry.
I am sure this must be a simple mistake, but I can't figure out what I am doing wrong. Preferably, I would like the format of the Registry Entry as a Date not a String.
Private Sub Workbook_Open()
Dim Rname as String
Dim Ddate as Date
GetSetting "PITB", "User Settings", "Full Name", ""
GetSetting "PITB", "User Settings", "Expiry", "3/30/2016"
Rem SaveSetting "PITB", "User Settings", "Full Name", "John Doe"
Rem SaveSetting "PITB", "User Settings", "Expiry", ""
RName = GetSetting("PITB", "User Settings", "Full Name")
Ddate = GetSetting("PITB", "User Settings", "Expiry")
MsgBox RName & Ddate
ActiveWindow.WindowState = xlMinimized
Rem SetRestrictions.Show
End Sub
I have a type mismatch on the date portion when I try to set a default date if there is no data exists in that registry entry.
I am sure this must be a simple mistake, but I can't figure out what I am doing wrong. Preferably, I would like the format of the Registry Entry as a Date not a String.
Private Sub Workbook_Open()
Dim Rname as String
Dim Ddate as Date
GetSetting "PITB", "User Settings", "Full Name", ""
GetSetting "PITB", "User Settings", "Expiry", "3/30/2016"
Rem SaveSetting "PITB", "User Settings", "Full Name", "John Doe"
Rem SaveSetting "PITB", "User Settings", "Expiry", ""
RName = GetSetting("PITB", "User Settings", "Full Name")
Ddate = GetSetting("PITB", "User Settings", "Expiry")
MsgBox RName & Ddate
ActiveWindow.WindowState = xlMinimized
Rem SetRestrictions.Show
End Sub