Free Microsoft Excel 2013
Quick Reference
Free Microsoft 2013 Quick Reference Guide

Free Microsoft Excel 2013 Quick Reference

Monthview control missing

I have recently had to replace a work computer and reloaded Excel 2003 (now running on Windows 7). The monthview control in a file we use regularly is no longer there, and just displays as a big red "x". The monthview control is not listed under the "more controls" option, and I have downloaded mscomct2.ocx to my System 32 file, but it still does not show up as an option. Any suggestions?


Post your answer or comment

comments powered by Disqus
On one of my PC, I'm missing the Monthview control which is causing excel to not execute when the file is opened. I was wondering how to install the control into this PC. I found it in the other one that had it.

The file is mscomct2.ocx

Thanks!!

I am having trouble formatting anything to do with the Format control toolbar. Specifically, when I select the List Box, and select Format Control, the next window should have 5 tabs (size, protection, properties, web, and control). I'm missing the CONTROL tab. But a colleague of mine goes through the same steps and he has the control tab.
I have selected all of the add-ins to see if that would help. No luck. So I'm sure my set-up for other toolbox options will encounter the same problem.
Any suggestions on how to fix this?

All~,

I am having trouble getting the above Event for the Microsoft MonthView Control to work

I have read the MSDN article below http://whidbey.msdn.microsoft.com/li...iewcontrol.asp and copied the EXACT code into the sample database attached below and receive the following attached error message when the form loads (or the event is triggered). This message only appears once and no formatting occurs.

I am trying to build a form with a Calendar control that looks at the dates in a recordset and formats them in the Calendar control in a different format (in this eg - bold).

I am also trying to avoid using thrid-party Active-X controls due to licensing and instability issues etc and would much prefer to use the packaged Microsoft ones to avoid installing additional controls on user's machines.

Does anyone know how I can get the Monthview Control to bold particular dates correctly (without showing the error message)...would I be missing a VBA Reference or something?

(I have also included another MonthView control on the Form to demonstrate the controls properties that show by default (pre-defined name etc)

Any assistance would be much appreciated

Thanks,

DW

When a user clicks on a date in the monthview, I would like VBA to select the entire week on that control. How do I acheive this?

I have been working on a workbook on which I have placed several activex controls including a calendar. The controls are on the sheet not on a form.

Everything works OK on most PC's on which I have tested but on 1 at my location and on several PC's at a remote office the calendar's grid is missing the day numbers and the horizontal lines. Also some of the controls seem to have locked up and can not be accessed nor edited. I believe that all of the PC's are running the same version of Windows XP and Excel 2000 SP-3

There are no Workbook Open type events to trigger this strange behaviour but there are events associated with controls which make Calls to other routines and set/unset the enabled property of some controls on the sheet. The PC's I have checked are running the same version of Excel which is delivered by Radia as are those in Scotland.

Has anyone come across this type of issue?

Office 2K Excel's scrollbar' format control has the following tabs:
-Size
-Protection
-Properties
-Web and
-Control

The control is missing in my Office 2K3 Excel. I need to set some control.
Any idea how to enable the tab? Your assistance will be highly appreciated!

sokan

Office 2K Excel's scrollbar' format control has the following tabs:
-Size
-Protection
-Properties
-Web and
-Control

The control is missing in my Office 2K3 Excel. I need to set some control.
Any idea how to enable the tab? Your assistance will be highly appreciated!

sokan

I cannot change the input range and cell link within the format control
option of a combo box.

Does anyone know why this control tab is missing?

Many thanks

Hello,

Have a 3 page userform; in Page1 MonthView Control, Page2 DTPicker Control, Page3 Text Boxes.

When I try to use the value of DTPicker control in a text box in Page3, it loses its current value and resets to default value. DTPicker is configured as dptTime and at some point I set min and max values.

It only happens whan I use a MultiPage event like MultiPageDateTime_Click and the value of DTPicker. All other text boxes in Page3 are updated correctly.

Initially Textbox is set in UserForm_Activate with this UDF:

	VB:
	
 UpdateData() 
    With Me 
        ... 
        .TextBoxDate.Value =  Format(Me.MonthSelection + Me.DTPickerAppointmentTime, "dd-mmmm-yyyy hh:nn ampm") 
        ... 
    End With 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
If I select Page3, the TextBox value is: 09-july-2012 09:30 a.m. If I go to Page2 DTPicker value is 09:30 a.m. So far so good.

Now I want to "auto update" the textbox value in Page3 when its tab is selected calling the same UDF:

	VB:
	
) 
    Select Case DateTimeForm.MultiPageDateTime.Value 
    Case Is = 2 
        UpdateData 
    End Select 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
If I select Page3, the TextBox value is: 09-july-2012 12:00 a.m. If I go to Page2 DTPicker value is now set to current time 07:30:24 a.m. ... Weird because have no other events or procedures that could change DTPicker value.

Then got rid of the UDF setting the value directly:

	VB:
	
) 
    Select Case DateTimeForm.MultiPageDateTime.Value 
    Case Is = 2 
        Me.TextBoxDate = Format(Me.MonthSelection + Me.DTPickerAppointmentTime, "dd-mmmm-yyyy hh:nn ampm") 
    End Select 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
Now, if I select Page3, the TextBox value again is: 09-july-2012 12:00 a.m. And in Page2. DTPicker value is ... as you may have guessed current time 07:
32:47 a.m ... strange behavior.

If I remove the DTPicker value:

	VB:
	
) 
    Select Case DateTimeForm.MultiPageDateTime.Value 
    Case Is = 2 
         'Me.TextBoxDate = Format(Me.MonthSelection + Me.DTPickerAppointmentTime, "dd-mmmm-yyyy hh:nn ampm")
        Me.TextBoxDate = Format(Me.MonthSelection, "dd-mmmm-yyyy hh:nn ampm") 
    End Select 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
TextBox value is: 09-july-2012 12:00 a.m. as expected, and in Page2, DTPicker value is 09:30 a.m.

At this point have no idea why DTPicker value is lost when Page3 is selected and set to current time when going back to Page2; is this a bug or am I missing something? Have tried other crazy things but all get me to the same point.

Any ideas or comments will be appreciated.

Regards, Oscar.

hi guys,

i've just upgraded my pc but when i tried to attach a date picker in a userform it is not found.

i searched the additional controls and could not find it.
any ideas?

thanks in advance for any help given

Hello,

I tested the following VBA-code (see below) in excel 2000 on Windows XP. And it works.

The code(see below) is used in a userform called CalendarUserForm (height 216 points, width 170
points) with
two CommandButtons (OKButton, CancelButton) on the userform. On the userform, the code creates
a month-calendar-control using the WIN-API.

I know i could use the Microsoft MonthView Control ActiveX-object in MSCOMCT2.OCX.
But it is difficult to distribute and install these ocx-files on other systems.

info about the month-calendar-control:
http://msdn.microsoft.com/library/de...l/monthcal.asp

I have a few questions about the code(see below):

1) Is this the correct way to create and use the month-calendar-control in VBA?
Is it correct code in general? Any remarks, comments about it?

I know i could use the Microsoft MonthView Control ActiveX-object in MSCOMCT2.OCX.
But it is difficult to distribute and install this ocx-files on other systems.

2) The month-calendar-object sends notification messages (MCN_SELCHANGE,
MCN_SELECT, MCN_GETDAYSTATE) to the parent(the userform) when it receives
user input. Currently, I ignore these messages. I do not process these messages.
Should i process these messages or is it safe not to process them?

3) What about destroying the month-calendar-object in UserForm_Terminate()?
Is it correct to send a WM_CLOSE-message to the object before using the DestroyWindow-call?
Or should I only perform the DestroyWindow-call ?

4) I use InitCommonControlsEx(). (A WIN-API-function).It registers the common control classes.
Is it safe the call this function several times, because it is called everytime ShowResult is
called.
Is there an opposite function which unregisters the common classes?
Something like UnInitCommonControlsEx

thanks,

Johan

----------
the code from CalendarUserForm.frm
----------

Option Explicit

' private variables

Private cal_result As VbMsgBoxResult ' return-value of ShowResult
Private cal_selected_date As Date ' current selected-date
Private cal_control_handle As Long 'handle to month-calendar-control

' const month-calendar-control
Private Const MCM_GETCURSEL As Long = &H1001
Private Const MCM_SETCURSEL As Long = &H1002
Private Const MCM_SETTODAY As Long = &H100C

Private Const ICC_DATE_CLASSES As Long = &H100
Private Const MONTHCAL_CLASS As String = "SysMonthCal32"

' windows-message
Private Const WM_CLOSE As Long = &H10

' const style
Private Const WS_CHILD As Long = &H40000000
Private Const WS_VISIBLE As Long = &H10000000
Private Const WS_BORDER As Long = &H800000

Private Type INITCOMMONCONTROLSEX_TYPE
dwSize As Long
dwICC As Long
End Type

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Declare Function MonthCal_GetCurSel Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As SYSTEMTIME) As Long

Private Declare Function MonthCal_SetCurSel Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As SYSTEMTIME) As Long

Private Declare Function InitCommonControlsEx Lib "comctl32" _
(ByRef lpInitCtrls As INITCOMMONCONTROLSEX_TYPE) As Long

Private Declare Function CreateWindowEx Lib "user32" _
Alias "CreateWindowExA" _
(ByVal dwExStyle As Long, _
ByVal lpClassName As String, _
ByVal lpWindowName As String, _
ByVal dwStyle As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hwndParent As Long, _
ByVal hMenu As Long, _
ByVal hInstance As Long, _
lpParam As Any) As Long

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" _
(ByVal hwndParent As Long, _
ByVal hwndChildAfter As Long, _
ByVal lpszClass As String, _
ByVal lpszWindow As String) As Long

Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long

Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Declare Function PostMessage Lib "user32" _
Alias "PostMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

' -------------------------------------------------------------------------------------

' Shows userform after it created the month-calendar-control
' the function returns when the user clicks on the OK-button or Cancel-button
' (SelectedDate is the date selected in the month calendar object)

Public Function ShowResult(ByRef SelectedDate As Date) As VbMsgBoxResult
On Error GoTo errorhandler
Err.Clear

' strip time-part of the selected date
SelectedDate = DateSerial(Year(SelectedDate), Month(SelectedDate), Day(SelectedDate))

OKButton.Enabled = False

cal_result = vbCancel ' returned when you use the upperright Close-button
cal_selected_date = SelectedDate
cal_control_handle = 0&

' determine handle to userform
Dim prevCaption As String
Me.Caption = CStr(Timer())

Dim userform_handle As Long
If Val(Application.Version) < 9 Then
userform_handle = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
userform_handle = FindWindow("ThunderDFrame", Me.Caption) 'XL2000
End If

Me.Caption = prevCaption

If userform_handle 0& Then

' determine handle to parent of month calendar control
' the parent is the first child of the userform

Dim parent_handle As Long
parent_handle = FindWindowEx(userform_handle, 0&, vbNullString, vbNullString)

If parent_handle 0& Then

Dim initCtrlsStruct As INITCOMMONCONTROLSEX_TYPE
initCtrlsStruct.dwICC = ICC_DATE_CLASSES
initCtrlsStruct.dwSize = Len(initCtrlsStruct)

If InitCommonControlsEx(initCtrlsStruct) 0 Then

' create month calendar control

cal_control_handle = CreateWindowEx(0, MONTHCAL_CLASS, vbNullString, _
WS_BORDER Or WS_CHILD Or WS_VISIBLE, 10, 10, 200, 200, _
parent_handle, 0&, 0&, ByVal 0&)

If cal_control_handle 0 Then
OKButton.Enabled = True
End If
End If
End If
End If

' show the userform with the month-calendar-object
' wait untill form is hidden

Me.Show
ShowResult = cal_result

If ShowResult = vbOK Then
SelectedDate = cal_selected_date
End If

Unload Me

Exit Function

errorhandler:
ShowResult = vbCancel
Unload Me
End Function

' set cal_result and hide userform

Private Sub CancelButton_Click()
cal_result = vbCancel
Me.Hide
End Sub

' determine current selected date
' if it succeeds to determine, set cal_result to vbOk and hide the userform

Private Sub OKButton_Click()
On Error GoTo errorhandler

If cal_control_handle 0& Then
Dim selected_system_time As SYSTEMTIME

If MonthCal_GetCurSel(cal_control_handle, MCM_GETCURSEL, 0&, _
selected_system_time) 0 Then

' strip time-part of current selected date

With selected_system_time
.wHour = 0
.wMinute = 0
.wSecond = 0
End With

cal_selected_date = SystemTimeToDate(selected_system_time)

If CDbl(cal_selected_date) >= 0 Then
cal_result = vbOK
Me.Hide
End If
End If
End If

Exit Sub

errorhandler:
cal_result = vbCancel
End Sub

' close month calendar control
' destroy month calendar control

Private Sub UserForm_Terminate()
On Error Resume Next

If cal_control_handle 0& Then
SendMessage cal_control_handle, WM_CLOSE, 0&, ByVal 0&
DestroyWindow cal_control_handle

cal_control_handle = 0&
End If
End Sub

' event is fired when you use the upperright Close-button

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next

' prevent unload !
' just hide it

If CloseMode = vbFormControlMenu Then
cal_result = vbCancel
Cancel = 1
Me.Hide
End If
End Sub

Private Function SystemTimeToDate(ByRef system_time As SYSTEMTIME) As Date
With system_time
SystemTimeToDate = DateSerial(.wYear, .wMonth, .wDay) + _
TimeSerial(.wHour, .wMinute, .wSecond)
End With
End Function

Private Function DateToSystemTime(ByVal Date_Value As Date) As SYSTEMTIME
Dim system_time As SYSTEMTIME

With system_time
.wYear = Year(Date_Value)
.wMonth = Month(Date_Value)
.wDayOfWeek = Weekday(Date_Value, vbSunday) - 1
.wDay = Day(Date_Value)
.wHour = Hour(Date_Value)
.wMinute = Minute(Date_Value)
.wSecond = Second(Date_Value)
.wMilliseconds = 0
End With

DateToSystemTime = system_time
End Function

----------
An example of how the userform CalendarUserForm is called:
(SelectedDate is the date selected in the month calendar object)

Public Function ShowCalendar(ByRef SelectedDate As Date) As VbMsgBoxResult
On Error GoTo errorhandler

ShowCalendar = CalendarUserForm.ShowResult(SelectedDate)

Exit Function

errorhandler:

ShowCalendar = vbCancel
End Function
----------

Hi All

I have got a MonthView control on my userform and it while it happily has a red circle around today's date it automatically selects the 12th November (the day I put it on my form in the first place) with a grey blob and if a user forgets to click on it to change the date it populates my worksheet with the 12th November

What I would really like it to do is to default that grey blob to today's date or even better not pick a date at all. I've tried putting all kinds of things in the Value box on its properties but I can only get it to accept a date other wise I get that lovely ‘Invalid property value’ warning!

Please can anyone tell me what I should put in to either make it not choose a date or if it must choose a date make it choose today? Or do I need to add some code to the MonthView?

Many thanks in advance

Rae

Hello,

I tested the following VBA-code (see below) in excel 2000 on Windows XP. And
it works

The code is used in a userform called CalendarUserForm (height 216 points,
width 170 points) with
two CommandButtons (OKButton, CancelButton) on the userform.On the userform,
the code creates
a month-calendar-control using the WIN-API.

I know i could use the Microsoft MonthView Control ActiveX-object in
MSCOMCT2.OCX.
But it is difficult to distribute and install these ocx-files on other
systems.

info about the month-calendar-object:
http://msdn.microsoft.com/library/de...l/monthcal.asp

I have a few questions about the code(see below):

1) Is this the correct way to create and use the month-calendar-control in
VBA?
Is it correct code in general? Any remarks, comments about it?

I know i could use the Microsoft MonthView Control ActiveX-object in
MSCOMCT2.OCX.
But it is difficult to distribute and install this ocx-files on other
systems.

2) The month-calendar-object sends notification messages (MCN_SELCHANGE,
MCN_SELECT, MCN_GETDAYSTATE) to the parent(the userform) when it receives
user input.
Currently, I ignore these messages. I do not process these messages. Should
i process these messages
or is it safe not to process them?

3) What about destroying the month-calendar-object in UserForm_Terminate()?
Is it correct to send a WM_CLOSE-message to the object before using the
DestroyWindow-call?
Or should I only perform the DestroyWindow-call ?

4) I use InitCommonControlsEx(). (A WIN-API-function).It registers the
common control classes.
Is it safe the call this function several times, because it is called
everytime ShowResult is called.
Is there an opposite function which unregisters the common classes?
Something like
UnInitCommonControlsEx

thanks,

Johan

----------
the code from CalendarUserForm.frm
----------

Option Explicit

' private variables

Private cal_result As VbMsgBoxResult ' return-value of ShowResult
Private cal_selected_date As Date ' current selected-date
Private cal_control_handle As Long 'handle to month-calendar-control

' const month-calendar-control
Private Const MCM_GETCURSEL As Long = &H1001
Private Const MCM_SETCURSEL As Long = &H1002
Private Const MCM_SETTODAY As Long = &H100C

Private Const ICC_DATE_CLASSES As Long = &H100
Private Const MONTHCAL_CLASS As String = "SysMonthCal32"

' windows-message
Private Const WM_CLOSE As Long = &H10

' const style
Private Const WS_CHILD As Long = &H40000000
Private Const WS_VISIBLE As Long = &H10000000
Private Const WS_BORDER As Long = &H800000

Private Type INITCOMMONCONTROLSEX_TYPE
dwSize As Long
dwICC As Long
End Type

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Declare Function MonthCal_GetCurSel Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As SYSTEMTIME) As Long

Private Declare Function MonthCal_SetCurSel Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As SYSTEMTIME) As Long

Private Declare Function InitCommonControlsEx Lib "comctl32" _
(ByRef lpInitCtrls As INITCOMMONCONTROLSEX_TYPE) As Long

Private Declare Function CreateWindowEx Lib "user32" _
Alias "CreateWindowExA" _
(ByVal dwExStyle As Long, _
ByVal lpClassName As String, _
ByVal lpWindowName As String, _
ByVal dwStyle As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hwndParent As Long, _
ByVal hMenu As Long, _
ByVal hInstance As Long, _
lpParam As Any) As Long

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" _
(ByVal hwndParent As Long, _
ByVal hwndChildAfter As Long, _
ByVal lpszClass As String, _
ByVal lpszWindow As String) As Long

Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As
Long

Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Declare Function PostMessage Lib "user32" _
Alias "PostMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

' set cal_result and hide userform

Private Sub CancelButton_Click()
cal_result = vbCancel
Me.Hide
End Sub

' determine current selected date
' if it succeeds to determine, set cal_result to vbOk and hide the userform

Private Sub OKButton_Click()
On Error GoTo errorhandler

If cal_control_handle 0& Then
Dim selected_system_time As SYSTEMTIME

If MonthCal_GetCurSel(cal_control_handle, MCM_GETCURSEL, 0&, _
selected_system_time) 0 Then

' strip time-part of current selected date

With selected_system_time
.wHour = 0
.wMinute = 0
.wSecond = 0
End With

cal_selected_date = SystemTimeToDate(selected_system_time)

If CDbl(cal_selected_date) >= 0 Then
cal_result = vbOK
Me.Hide
End If
End If
End If

Exit Sub

errorhandler:
cal_result = vbCancel
End Sub

' close month calendar control
' destroy month calendar control

Private Sub UserForm_Terminate()
On Error Resume Next

If cal_control_handle 0& Then
SendMessage cal_control_handle, WM_CLOSE, 0&, ByVal 0&
DestroyWindow cal_control_handle

cal_control_handle = 0&
End If
End Sub

' event is fired when you use the upperright Close-button

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next

' prevent unload !
' just hide it

If CloseMode = vbFormControlMenu Then
cal_result = vbCancel
Cancel = 1
Me.Hide
End If
End Sub

' Shows userform after it created the month-calendar-control
' the function returns when the user clicks on the OK-button or
Cancel-button
' (SelectedDate is the date selected in the month calendar object)

Public Function ShowResult(ByRef SelectedDate As Date) As VbMsgBoxResult
On Error GoTo errorhandler
Err.Clear

' strip time-part of the selected date
SelectedDate = DateSerial(Year(SelectedDate), Month(SelectedDate),
Day(SelectedDate))

OKButton.Enabled = False

cal_result = vbCancel ' returned when you use the upperright
Close-button
cal_selected_date = SelectedDate
cal_control_handle = 0&

' determine handle to userform
Dim prevCaption As String
Me.Caption = CStr(Timer())

Dim userform_handle As Long
If Val(Application.Version) < 9 Then
userform_handle = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
userform_handle = FindWindow("ThunderDFrame", Me.Caption) 'XL2000
End If

Me.Caption = prevCaption

If userform_handle 0& Then

' determine handle to parent of month calendar control
' the parent is the first child of the userform

Dim parent_handle As Long
parent_handle = FindWindowEx(userform_handle, 0&, vbNullString,
vbNullString)

If parent_handle 0& Then

Dim initCtrlsStruct As INITCOMMONCONTROLSEX_TYPE
initCtrlsStruct.dwICC = ICC_DATE_CLASSES
initCtrlsStruct.dwSize = Len(initCtrlsStruct)

If InitCommonControlsEx(initCtrlsStruct) 0 Then

' create month calendar control

cal_control_handle = CreateWindowEx(0, MONTHCAL_CLASS,
vbNullString, _
WS_BORDER Or WS_CHILD Or WS_VISIBLE, 10, 10, 200, 200, _
parent_handle, 0&, 0&, ByVal 0&)

If cal_control_handle 0 Then
OKButton.Enabled = True
End If
End If
End If
End If

' show the userform with the month-calendar-object
' wait untill form is hidden

Me.Show
ShowResult = cal_result

If ShowResult = vbOK Then
SelectedDate = cal_selected_date
End If

Unload Me

Exit Function

errorhandler:
ShowResult = vbCancel
Unload Me
End Function

Private Function SystemTimeToDate(ByRef system_time As SYSTEMTIME) As Date
With system_time
SystemTimeToDate = DateSerial(.wYear, .wMonth, .wDay) + _
TimeSerial(.wHour, .wMinute, .wSecond)
End With
End Function

Private Function DateToSystemTime(ByVal Date_Value As Date) As SYSTEMTIME
Dim system_time As SYSTEMTIME

With system_time
.wYear = Year(Date_Value)
.wMonth = Month(Date_Value)
.wDayOfWeek = Weekday(Date_Value, vbSunday) - 1
.wDay = Day(Date_Value)
.wHour = Hour(Date_Value)
.wMinute = Minute(Date_Value)
.wSecond = Second(Date_Value)
.wMilliseconds = 0
End With

DateToSystemTime = system_time
End Function

----------
An example of how the userform CalendarUserForm is called:
(SelectedDate is the date selected in the month calendar object)

Public Function ShowCalendar(ByRef SelectedDate As Date) As VbMsgBoxResult
On Error GoTo errorhandler

ShowCalendar = CalendarUserForm.ShowResult(SelectedDate)

Exit Function

errorhandler:

ShowCalendar = vbCancel
End Function
----------

Hello All

I require the user to input the month and year. For any date input I
like to use the Microsoft Month View control. However, in this case I
think this would be too much since I'm not interested in the specific
day, and I don't want the user to think that I am.

* Am I able to adapt the MonthView control to not show the days, but
just show the month and year pickers?
* Is there another ready-prepared control I could use

I'm trying to avoid using input boxes and self-prepared userforms,
because they're time consuming, and because I'd like the form to adapt
to the system language.

Thanks in advance

Hello

I would like to use a combo box, however the control tab where you define the list range and destination cell is missing. Does anybody know how to activate it?

excel 97

Thanks

I have a pop-up calendar in a workbook but when I try to activate it, it errors. In the Tools - References it states the following:
Missing: Microsoft Windows Common Controls-3 6.0 and it refers to
comct332.ocx in Windows-System32.
I checked in the System32 folder and there I have comct232.ocx but not comct332.ocx.
Searching for this on the windows site references to a VB6Cli.exe program as follows: VB6Cli.exe is a utility that fixes design-time licenses used by ActiveX controls installed with Microsoft Visual Basic 6.0.
I have searched the Microsoft site to download either files (VB6Cli.exe and comct332.ocx) but no luck.
I have Microsoft Visual Basic 6.3 and WinXP Professional.
Any help on this matter is greatly appreciated
Thanks and regards.
John

I have an Excel application created in Excel 2003 that uses a common dialog control.
I used the application on a machine with Excel 2000 and received a compile error, which I traced to "MISSING Common Dialog Control" in
In the tool box - more controls, the common dialog control is not listed.
How do I install the Control and how do I ensure it will work on other machines with Excel 2000 ?

I have recently upgraded to Vista and have started experiencing problems with several of my VBA Excel Macros. When I open up my spreadsheet I get the following errors

Compile Error:

Can't find project or a library

When I got the the Tools->References menu I notice that one of the Libraries is marked as Missing.

MISSING: Active Setup Control Library.

I can uncheck that box and everything will work properly sort of. Unfortunately Macros that run daily that ran in 30 sec in XP are now taking 5-10 minutes. I don't know if these problems are related or not. It is possible to restor a missing library?

My setup is as follows:

Dell Inspiron E1505
Intel Core2 Duo 2.0 Ghz processor
1 GB RAM
Windows Vista Home Premium
Microsoft Excel 2003

Thanks for the help.

Britt

The old excel versions used to have a tab called 'control' in the format control section of a combo box. My excel 2000 version seems to miss this tab. How am i meant to set the INPUT RANGE, CELL LINK and DROP-DOWN LINES without this facility ?? I have no ability with VBA so relied on this heavily. I've been making do by copy/pasting an old version of a combo box into my new documents 'cause they of course have the control tab. Any ideas???????

Code works in XL2000 but not in XP!?
Please can anybody help?......and thanks in advance for looking.

I'm using the code below on a number input macro to check to see if the
number entered is the same as the validation code in hidden sheet1!A1.

It works perfectly in Excel 2000 but a user reports that in Excel XP he
gets the message: "Compile error in module 2". When I looked at it it
appears that the problem is at the point of 'MyNum' in the 6th row.

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

Sub InputNumber()
Application.ScreenUpdating = False
Application.EnableCancelKey = xlDisabled
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Select
myNum = InputBox("Please enter your 8 digit validation code. If you
don't know it please contact XXXX", "Box Title")
If myNum = "" Then
Sheets("Sheet1").Visible = False
Sheets("Setup Sheet").Select
Application.ScreenUpdating = True
Exit Sub
End If
Range("A1").Value = myNum
Sheets("Sheet1").Visible = xlSheetVeryHidden

Sheets("Setup Sheet").Select
Application.ScreenUpdating = True
End Sub
-------------------------------------------------------------

Jim Rech advised me to look in ‘Tools’ and ‘References…’ in the VBE to
see if anything was listed as ‘missing’, and in there it says "MISSING:
OCWebPreview ActiveX Control Module".

This needs to be usable by anyone with XL2000 or later. Can you anyone
suggest a work-around that would enable this to happen? Different code
maybe that gives the same results?

How can I overcome this even on a single PC?

Can I get an auto-open macro to make whatever changes are required to
make it work or should I look for an alternative code that won't cause
this to happen?

Thanks for your help.

Regards,

---
Message posted from http://www.ExcelForum.com/

My ActiveX Control Toolbox does not contain the Frame control. I've
checked two other PCs running Excel 2000 in our office, and they don't
have it either. If I go to More Controls on the ActiveX toolbar,
there is a Microsoft Forms 2.0 Frame, but it covers up the option
buttons, so it's no help. According to Help, the Frame should be one
of the standard ActiveX controls; my toolbox has all the others listed
except that one. Does anyone know how to get it back? (I do have the
Excel Frame control; it's the ActiveX one that's missing.) Thanks for
any help.

This control is missing from my list of controls at Developer>Insert
controls>more controls, or in the long list it is no longer called 'calendar
control'. Is it elsewhere?

I am using XP 2003 I notice that in the VBA toolbox when you right click in
it to select additional controls there are some missing that my office
computer has. Specifically -Microsoft Date & Time Picker Controls 6.0 (SP4).

Is there some placing I'm not looking to add it, maybe a download,etc.?
Thank you for your help.
--
Though daily learning, I LOVE EXCEL!
Jennifer

I created a spreadsheet for work that uses quite a bit of macros that I wrote in VBA.

Everything was running well, until I attempted to add a splashscreen, that launches a macro. The macro performs a web query on a small website, and if a cell range is valid, it continues running. If not valid, it closes the workbook.
I saved the file.

Now when I try to load the file, I get the following Error.

"Error in loading DLL"

I went to VBE and checked TOOLS>REFERENCES

and there is a MISSING: Ref Edit Control listed.
I try to uncheck the box and I get the error "Can't perform requested operation"

I'm at a complete Loss.

I have noticed that I can't pull up any of the Modules....

Any suggestions would be greatly appreciated!


No luck finding an answer? You could always try Google.