Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
error in getting system dates
Dear all
one comp is strange "the object or library doesn't support" error was in this line Code: ThisDay = Date using macro from this link http://www.ozgrid.com/forum/showthread.php?t=30327 thanks Youtham |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
error in getting system dates
It appears you are using custom code provided in that forum. The author or
poster of the code, who is working with you there, would be the best source of assistance. the only code you show: ThisDay = Date If ThisDay is an object, there is no way of us knowing what kind of object it is. Date certainly isn't an object. -- Regards, Tom Ogilvy "Youtham" wrote in message ... Dear all one comp is strange "the object or library doesn't support" error was in this line Code: ThisDay = Date using macro from this link http://www.ozgrid.com/forum/showthread.php?t=30327 thanks Youtham |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
error in getting system dates
thx Tom
here are entire code Option Explicit Dim ThisDay As Date Dim ThisYear, ThisMth Dim CreateCal As Boolean Dim i As Integer Private Sub UserForm_Initialize() Application.EnableEvents = False ThisDay = Date ThisMth = Format(ThisDay, "mm") ThisYear = Format(ThisDay, "yyyy") 'For i = 1 To 12 ' CB_Mth.AddItem Format((i) & "/1/" & (ThisYear), "mmmm") 'Next For i = 1 To 12 CB_Mth.AddItem Format(DateSerial(Year(Date), Month(Date) + i, 0), "mmmm") Next 'CB_Mth.ListIndex = (ThisMth) - 1 CB_Mth.ListIndex = Format(Date, "mm") - Format(Date, "mm") For i = -20 To 50 If i = 1 Then CB_Yr.AddItem Format((ThisDay), "yyyy") Else CB_Yr.AddItem _ Format((DateAdd("yyyy", (i - 1), ThisDay)), "yyyy") Next CB_Yr.ListIndex = 21 CreateCal = True Call Build_Calendar Application.EnableEvents = True End Sub Private Sub CB_Mth_Change() Build_Calendar End Sub Private Sub CB_Yr_Change() Build_Calendar End Sub Private Sub Build_Calendar() If CreateCal = True Then CalendarFrm.Caption = " " & CB_Mth.Value & " " & CB_Yr.Value CommandButton1.SetFocus For i = 1 To 42 If i < Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value)) Then Controls("D" & (i)).Caption = Format(DateAdd("d", (i - Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), _ ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "d") Controls("D" & (i)).ControlTipText = Format(DateAdd("d", (i - Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), _ ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "m/d/yy") ElseIf i = Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value)) Then Controls("D" & (i)).Caption = Format(DateAdd("d", (i - Weekday((CB_Mth.Value) _ & "/1/" & (CB_Yr.Value))), ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "d") Controls("D" & (i)).ControlTipText = Format(DateAdd("d", (i - Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), _ ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "m/d/yy") End If If Format(DateAdd("d", (i - Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), _ ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "mmmm") = ((CB_Mth.Value)) Then If Controls("D" & (i)).BackColor < &H80000016 Then Controls("D" & (i)).BackColor = &H80000018 '&H80000010 Controls("D" & (i)).Font.Bold = True If Format(DateAdd("d", (i - Weekday((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), _ ((CB_Mth.Value) & "/1/" & (CB_Yr.Value))), "m/d/yy") = Format(ThisDay, "m/d/yy") Then Controls("D" & (i)).SetFocus Else If Controls("D" & (i)).BackColor < &H80000016 Then Controls("D" & (i)).BackColor = &H8000000F Controls("D" & (i)).Font.Bold = False End If Next End If End Sub regards, Utham "Tom Ogilvy" wrote: It appears you are using custom code provided in that forum. The author or poster of the code, who is working with you there, would be the best source of assistance. the only code you show: ThisDay = Date If ThisDay is an object, there is no way of us knowing what kind of object it is. Date certainly isn't an object. -- Regards, Tom Ogilvy "Youtham" wrote in message ... Dear all one comp is strange "the object or library doesn't support" error was in this line Code: ThisDay = Date using macro from this link http://www.ozgrid.com/forum/showthread.php?t=30327 thanks Youtham |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error accessing system registry | Excel Discussion (Misc queries) | |||
System Error | Excel Worksheet Functions | |||
Subtract Dates based on 24 hour system | Excel Worksheet Functions | |||
Excel System Error??? | Excel Worksheet Functions | |||
system error &H8000FFFF | Excel Programming |