Solved

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

Posted on 2011-09-28
32
2,268 Views
Last Modified: 2012-05-12

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.

0
Comment
Question by:philkryder
  • 15
  • 11
  • 3
32 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36817781
you can simply edit the hta with any editor i.e. notepad pull out the calendar items and post the code here
0
 
LVL 1

Author Comment

by:philkryder
ID: 36892657
I want a calendar object that works in W7 with office 2010
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36894900
what are you using now? can you upload a sanitized hta as a text file?
0
 
LVL 1

Author Comment

by:philkryder
ID: 36895159
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
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36914914
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36921420
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
 
LVL 1

Author Comment

by:philkryder
ID: 36928136

>>>
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928155
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
 
LVL 1

Author Comment

by:philkryder
ID: 36945937
Mods - please delete - no points
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36945978
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
 
LVL 1

Author Comment

by:philkryder
ID: 36946181
because I need a solution that DOES work in 2010

Where/how does one CLOSE a question.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36946274
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36946352
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
 
LVL 1

Author Comment

by:philkryder
ID: 36946426
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 65

Expert Comment

by:RobSampson
ID: 36946430
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
 
LVL 1

Author Comment

by:philkryder
ID: 36949796
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36953286
0
 
LVL 1

Author Comment

by:philkryder
ID: 36953685

Rob -
I still don't get the down arrow or a text box to click into - just a button.
Phil
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36953728
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36953756
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
 
LVL 1

Author Comment

by:philkryder
ID: 36953759
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
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 36954519
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
 
LVL 1

Author Comment

by:philkryder
ID: 36963240
I have 64 bit W7
and
32 bit office
but,
I CAN'T find the MSCOMCT2.OCX...
0
 
LVL 1

Author Comment

by:philkryder
ID: 36963324
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
 
LVL 1

Author Comment

by:philkryder
ID: 36963409
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
 
LVL 1

Author Comment

by:philkryder
ID: 36963434
now,
I see that I registered
MSCOMCTL.ocx BUT, I don't have
mscomct2.ocx

where to get it?
0
 
LVL 1

Author Comment

by:philkryder
ID: 36963489

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
 
LVL 1

Author Closing Comment

by:philkryder
ID: 36963496
see comments in thread - thanks Rob - much appreciated. Phil
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36965279
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now