?how can I fix an hta with calendar control not working on w7?


I have an HTA that uses the calendar on XP with office 2003.

How do I repair the calendar?
It doesn't work on w7 with office 2010.

LVL 1
philkryderAsked:
Who is Participating?
 
RobSampsonCommented:
Just look in that folder and see.

On 32 bit, make sure
c:\Windows\System32\mscomct2.ocx
exists, and run
regsvr32 c:\Windows\System32\mscomct2.ocx
to make sure it's registered.

On 64 bit, make sure
c:\Windows\SysWOW64\mscomct2.ocx
exists, and run
regsvr32 c:\Windows\SysWOW64\mscomct2.ocx
to make sure it's registered.

Rob.
0
 
David Johnson, CD, MVPOwnerCommented:
you can simply edit the hta with any editor i.e. notepad pull out the calendar items and post the code here
0
 
philkryderAuthor Commented:
I want a calendar object that works in W7 with office 2010
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
David Johnson, CD, MVPOwnerCommented:
what are you using now? can you upload a sanitized hta as a text file?
0
 
philkryderAuthor Commented:
here you go:



<HTML>
<HEAD>
<TITLE>Date Picker</TITLE>
</HEAD>
<SCRIPT language="VBScript">
<!--
Sub OKButton_OnClick
OkClicked.Value = 1
End Sub
'-->
</SCRIPT>

<BODY bgcolor="buttonface">

<p align="center">

<OBJECT CLASSID="clsid:8E27C92B-1264-101C-8A2F-040224009C02"
id=Calendar1>
<param name="BackColor" value="-2147483633">
<param name="DayLength" value="1">
<param name="MonthLength" value="1">
<param name="DayFontColor" value="0">
<param name="FirstDay" value="7">
<param name="GridCellEffect" value="1">
<param name="GridFontColor" value="10485760">
<param name="GridLinesColor" value="-2147483632">
<param name="ShowDateSelectors" value="-1">
<param name="ShowDays" value="-1">
<param name="ShowHorizontalGrid" value="-1">
<param name="ShowTitle" value="-1">
<param name="ShowVerticalGrid" value="-1">
<param name="TitleFontColor" value="10485760">
<param name="ValueIsNull" value="0">
</OBJECT>

<br>
<INPUT NAME="OKButton" TYPE="BUTTON" VALUE="OK" >
<input type="hidden" name="OKClicked" size="20"></P>
</BODY>
</HTML>
0
 
David Johnson, CD, MVPOwnerCommented:
I've looked for other calendar dll's that might help to no avail except a .net solution which is more of an application than just an hta.

requested moderator to help you either to delete it or to get more experts to help you (neglected question)
0
 
RobSampsonCommented:
Hi, from here:
http://www.rondebruin.nl/calendar.htm

It states:
"Download the control from MVP Graham Mayor's site and read the information
in the PDF that you also find in the download good so you know how to register the control.
Note: The 2007 version will also work in Excel 2010 32 bit but not in Excel 2010 64 bit
http://www.gmayor.com/Zips/MSCAL.zip"

So since the calendar control is removed from Office 2010, you will need to download the 2007 one and register it on your system.

If you want to use the Office 2010, it looks you have to use the DatePicker control now, which appears to have a CLSID of 20DD1B9E-87C4-11D1-8BE3-0000F8754DA1.

Regards,

Rob.
0
 
philkryderAuthor Commented:

>>>
If you want to use the Office 2010, it looks you have to use the DatePicker control now, which appears to have a CLSID of 20DD1B9E-87C4-11D1-8BE3-0000F8754DA1.
<<<
Do you have HTA code that successfully uses that CLSID?
I get an error on on the METHOD.
0
 
RobSampsonCommented:
No, I haven't got Office 2010.....The methods available to that control are shown here:
http://msdn.microsoft.com/en-us/library/system.windows.controls.datepicker_methods(v=vs.95).aspx

Rob.
0
 
philkryderAuthor Commented:
Mods - please delete - no points
0
 
RobSampsonCommented:
Please click either Request Attention, or submit your own closure request, stating your reasons for deleting the question.

FYI, I have stated *why* the control doesn't work with Office 2010, and provided a possible workaround.  Can you elaborate on why you just want to delet the question?

Rob.
0
 
philkryderAuthor Commented:
because I need a solution that DOES work in 2010

Where/how does one CLOSE a question.
0
 
RobSampsonCommented:
You should be able to find a link to delete the question, and state your reason.

Have a look at the small HTA here as an example of the DatePicker control:
http://www.eggheadcafe.com/microsoft/VBScript/30420237/getting-date-from-daymonthyear-dropdowns.aspx

Rob.
0
 
RobSampsonCommented:
Actually, it turns out the control must be on my system, because this worked.

Rob.
<Html>
<Head>
<Title>List OU Groups and Users</Title>
 
<HTA:Application
	WINDOWSTATE="normal"
	SCROLL = "no"
	BORDERSTYLE="normal"
	BORDER="thin"
	CAPTION="yes"
	MAXIMIZEBUTTON="no"
	MINIMIZEBUTTON="no"
	SHOWINTASKBAR="yes"
	SINGLEINSTANCE="yes"
	SYSMENU="yes"
	VERSION="1.0"
>
<script language="vbscript">
Sub Window_OnLoad
	window.ResizeTo 350,300
End Sub

Sub btnReadDate_onClick()
	' MsgBox("click event detected")
	MsgBox("The msCAL control reads: " & vbCrLf & vbCrLf _
	& CStr(oDTP.Month) & "/" & CStr(oDTP.Day) & "/" _
	& CStr(oDTP.Year))
End Sub
</script>
</head>
<body>
<button name="btnReadDate" id="btnReadDate">Show Date</button>
<OBJECT CLASSID="CLSID:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1" id="oDTP">
you must click on the down arrow to the right of
the textbox above.<br>
</body>
</html>

Open in new window

0
 
philkryderAuthor Commented:
Rob - I don't get a "down arrow" - just a button - and when I click the button I get an error that the oDTP object is needed.
0
 
RobSampsonCommented:
Is that on a machine with office 2010 installed?  Try running
regsvr32 c:\windows\system32\mscomct2.ocx

and see if it registers correctly after that.

Rob.
0
 
philkryderAuthor Commented:
64 BIT HERE - both w7 and office -


the object seems to be registered - but I don't see the values you use in the reverence to the methods you gave
0
 
RobSampsonCommented:
0
 
philkryderAuthor Commented:

Rob -
I still don't get the down arrow or a text box to click into - just a button.
Phil
0
 
RobSampsonCommented:
Are you sure you have mscomct2.ocx?

I tried it on a system without mscomct2.ocx and it didn't show anything either.

Rob.
0
 
RobSampsonCommented:
I also just tried it on a 64 bit system with
regsvr32 c:\windows\syswow64\mscomct2.ocx

and it worked fine.

Make sure you have mscomct2.ocx in the syswow64 folder.

Rob.
<Html>
<Head>
<Title>Test DateTimePicker Control</Title>
 
<HTA:Application
	WINDOWSTATE="normal"
	SCROLL = "no"
	BORDERSTYLE="normal"
	BORDER="thin"
	CAPTION="yes"
	MAXIMIZEBUTTON="no"
	MINIMIZEBUTTON="no"
	SHOWINTASKBAR="yes"
	SINGLEINSTANCE="yes"
	SYSMENU="yes"
	VERSION="1.0"
>
<script language="vbscript">
Sub Window_OnLoad
	window.ResizeTo 600,600
End Sub

Sub btnReadDate_onClick()
	' MsgBox("click event detected")
	MsgBox("The msCAL control reads: " & vbCrLf & vbCrLf _
	& CStr(oDTP.Month) & "/" & CStr(oDTP.Day) & "/" _
	& CStr(oDTP.Year))
End Sub
</script>
</head>
<body>
<button name="btnReadDate" id="btnReadDate">Show Date</button><br><br>
DateTimePickerControl|<OBJECT CLASSID="CLSID:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1" id="oDTP"></OBJECT>|DateTimePickerControl
<br>you must click on the down arrow to the right of
the textbox above.<br>
</body>
</html>

Open in new window

0
 
philkryderAuthor Commented:
what is the best way to know for sure?

I know I am running office 2010 - 32 bit on this machine - 64bit on others
0
 
philkryderAuthor Commented:
I have 64 bit W7
and
32 bit office
but,
I CAN'T find the MSCOMCT2.OCX...
0
 
philkryderAuthor Commented:
SCRATCH THAT
I found mscomct2.ocx
in c:\windows\sysWOW64

but, it won't register.

I even tried running the command prompt as admin
and browsing to
 c:\windows\sysWOW64
still wouldn't register.

0
 
philkryderAuthor Commented:
and now
I copied this
regsvr32 c:\windows\SysWOW64\MSCOMCTL.ocx
regsvr32 c:\Windows\SysWOW64\mscomct2.ocx
from another google search and it succeeded?
why
is this the same?
0
 
philkryderAuthor Commented:
now,
I see that I registered
MSCOMCTL.ocx BUT, I don't have
mscomct2.ocx

where to get it?
0
 
philkryderAuthor Commented:

It finally worked.

I found this:

If you need an up to date version of mscomct2.ocx you can get it from

>>>>http://activex.microsoft.com/controls/vb6/mscomct2.cab<<<

I downloaded and tried to install to WINDOWS\SYSWOW64 - but failed.
so
I installed to another library.
then used the administrator command prompt to copy it to SYSWOW64
then used the administraor command prompt to register it

then Robs sample worked just fine.

thanks much.
Phil
0
 
philkryderAuthor Commented:
see comments in thread - thanks Rob - much appreciated. Phil
0
 
RobSampsonCommented:
Wow!  Nice work. I'm glad you finally got there.  Now, just to offer another small bit of advice, in your HTA you could check for the existence of the MSComCT2.ocx file on the system, and if it is there, use the new control, otherwise if it's not there, use the old control.  That could help you be compatibly with more systems.

Regards,

Rob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.