Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
error accessing system registry Donna Excel Discussion (Misc queries) 2 July 11th 06 09:22 PM
System Error Mike McLellan Excel Worksheet Functions 0 May 5th 06 07:32 AM
Subtract Dates based on 24 hour system Well Missy Excel Worksheet Functions 2 April 5th 06 08:41 PM
Excel System Error??? JJ Excel Worksheet Functions 3 January 1st 06 12:32 AM
system error &H8000FFFF steve Excel Programming 2 January 7th 04 09:22 AM


All times are GMT +1. The time now is 01:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"