Thread: Date Validation
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Date Validation

Some possible sources of information - may be dated:

http://www.microsoft.com/officedev/index/calendar.htm
Calendar control
[Includes links to 3 articles on the calendar control including
"Using a Calendar Control in Excel"]

http://support.microsoft.com/Support/?kbid=170692
ADT/ODE: Can't Redistribute Calendar Control Without ODE License

http://www.microsoft.com/officedev/tips/regactx.htm
Get the Calendar Control

http://support.microsoft.com/Support/?kbid=165450
XL97: Error Inserting ActiveX Object in a Worksheet



http://support.microsoft.com/Support/?kbid=279098
MOD2000: Cannot Redistribute Calendar Control Without Microsoft Office
Developer License

http://support.microsoft.com/Support/?kbid=236529
MOD2000: Deploying Package with MSCal.ocx Causes Error: "The file
....\$(DllSelfRegisterEx) Could Not Be Registered..."



=====Register the control:
you can register the ocx file yourself.

It should be is MSCAL.OCX in the Windows/sytem directory


Go to Start=Run from the windows taskbar

type this to register the OCX

regsvr32.exe c:\windows\system\mscal.ocx

to unregister

regsvr32.exe /u c:\windows\system\mscal.ocx

Once you do that, you can create a reference to the control in Excel in the
VBE in Tools=References

===============<Function to see if Calendar Control is Installed====

Posted by Jake Marx

p://x46.deja.com/[ST_rn=ps]/getdoc.xp?AN=618556435

From: "Jake Marx" <
Subject: Dectecting if computer has Excel control
Date: 02 May 2000 00:00:00 GMT
Message-ID: <ecNh2eLt$GA.264@cppssbbsa03
References:
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-MSMail-Priority: Normal
Newsgroups: microsoft.public.excel.programming

Hi Stefano,

You could try calling this function to see if the Calendar control is
installed on the client machine:

Public Function bCalCtlInstalled() As Boolean
Dim objCal As Object

On Error Resume Next

Set objCal = CreateObject("MSCAL.Calendar")
bCalCtlInstalled = Not objCal Is Nothing
Set objCal = Nothing
End Function


Regards,
Jake Marx

-------------

--
Regards,
Tom Ogilvy

"Nigel" wrote in message
...
Tom
Thanks for the tips, code works great. Need to investigate how to use the
mscal.ocx control, presumably it has a properties that can be used in VBA
code
Cheers
Nigel

"Tom Ogilvy" wrote in message
...
IsDate(Textbox1.Text)

or:

Private Sub CommandButton1_Click()
Dim DtVal As Date
DtVal = 0
On Error Resume Next
DtVal = CDate(TextBox1.Text)
On Error GoTo 0
If Not DtVal = 0 Then
Label1.Caption = "Good Date"
Else
Label1.Caption = "Bad DAte"
End If
End Sub

as an example.

Look at the Calendar Control

mscal.ocx I believe. It might be available in the VBE under tools=
Additional controls (available when you userform has the focus)

--
Regards,
Tom Ogilvy




"Nigel" wrote in message
...
1. I have a number of userform textbox controls that are designated as

dates
(European Format dd/mm/yy). What is the best method of validating

date
entry?

2. Related to 1 above, are there any active-x controls that I can use

to
display a calendar that pops up when the user enters the textbox that
requires a date to be entered?

TIA

Nigel






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World!

100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---