Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Excel workbook that I have been using for 6-7 years, initially in
Excel 2003; and more recently in Excel 2007 (where it is saved as an .xlsm file). There is a user form to enter data, and one of the pieces of data is a Date. I could either enter the date directly, or select the different sections (M/D/Y) and use up/down arrows to change the date. I don't recall how I set this up initially. I copy this file back and forth between two different machines -- a Windows XP machine; and a Windows 7 machine. Today I opened it on the Windows 7 machine, and the Date field on the user form was gone! The code is still there. It merely sets the initial value to today. FirstRun is a variable that gets set to TRUE by UserForm_Initialize ======================== Private Sub Dt_Enter() If FirstRun = True Then Dt.Value = Int(Now()) FirstRun = False End If End Sub ====================== Why did the Date field disappear? How did I set this up in the first place? Thanks. --ron |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It almost sounds like you are describing the DatePicker control. While I'm
not sure why it went away, I do remember that it is not a native Windows control; rather, it came with the compiled version of Visual Basic (Common Controls as I remember) and would be available on your system if you installed VB5 or VB6 or installed any program that relied on the VB5 or VB6 runtime DLL. Perhaps one of your computers doesn't have the DatePicker control available and the Reference to it was lost? You could try checking the References for the project and see if it is available or not and, if not, try to activate the reference to it. -- Rick (MVP - Excel) "Ron Rosenfeld" wrote in message ... I have an Excel workbook that I have been using for 6-7 years, initially in Excel 2003; and more recently in Excel 2007 (where it is saved as an .xlsm file). There is a user form to enter data, and one of the pieces of data is a Date. I could either enter the date directly, or select the different sections (M/D/Y) and use up/down arrows to change the date. I don't recall how I set this up initially. I copy this file back and forth between two different machines -- a Windows XP machine; and a Windows 7 machine. Today I opened it on the Windows 7 machine, and the Date field on the user form was gone! The code is still there. It merely sets the initial value to today. FirstRun is a variable that gets set to TRUE by UserForm_Initialize ======================== Private Sub Dt_Enter() If FirstRun = True Then Dt.Value = Int(Now()) FirstRun = False End If End Sub ====================== Why did the Date field disappear? How did I set this up in the first place? Thanks. --ron |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 21 Mar 2010 16:07:04 -0400, "Rick Rothstein"
wrote: It almost sounds like you are describing the DatePicker control. While I'm not sure why it went away, I do remember that it is not a native Windows control; rather, it came with the compiled version of Visual Basic (Common Controls as I remember) and would be available on your system if you installed VB5 or VB6 or installed any program that relied on the VB5 or VB6 runtime DLL. Perhaps one of your computers doesn't have the DatePicker control available and the Reference to it was lost? You could try checking the References for the project and see if it is available or not and, if not, try to activate the reference to it. -- Rick (MVP - Excel) Rick, After I posted that I realized that it was the DatePicker control. I had thought that to be the case, but initially could not find it. And I think you're correct about it being a reference problem, possibly due to the fact that my XP machine is 32 bit and the W7 machine is 64 bit. I'm thinking this because when I finally located the reference containing the DatePicker control on my W7 machine, it has a "64" in the pathname: C:\Windows\SysWOW64\mscomct2.ocx I believe that file is in the Windows\System32 folder on an XP machine (at least it is on the XP Virtual Machine that I have on my W7-64 computer. Interesting gotcha. Thanks. --ron |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I believe that file is in the Windows\System32 folder on an XP machine (at
least it is on the XP Virtual Machine that I have on my W7-64 computer. Really? Do you have to do something to activate it? When I installed Vista on my computer a few months ago, (I could be wrong about this... old age and all<g) I am almost positive that I looked to see if I could add the DatePicker control to a UserForm and couldn't until after I installed my copy of the compiler version of VB6. -- Rick (MVP - Excel) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 22 Mar 2010 09:49:40 -0400, "Rick Rothstein"
wrote: I believe that file is in the Windows\System32 folder on an XP machine (at least it is on the XP Virtual Machine that I have on my W7-64 computer. Really? Do you have to do something to activate it? When I installed Vista on my computer a few months ago, (I could be wrong about this... old age and all<g) I am almost positive that I looked to see if I could add the DatePicker control to a UserForm and couldn't until after I installed my copy of the compiler version of VB6. Well, I definitely did not install VB6. In W7, the Date/Time picker did not appear initially on the VBA userform ToolBox. But when I right-clicked on the toolbox, and selected the option to add more controls, in the drop down list (once I finally found it) there was an entry for "Microsoft Date and Time Picker Control 6.0(SP4)" I've never had a Vista machine. --ron |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Which version of Mscomct2.ocx do you have, which contains the DTPicker. If
not 6.1.98.16 see here and install the latest http://support.microsoft.com/kb/957924 Regards, Peter T "Rick Rothstein" wrote in message ... I believe that file is in the Windows\System32 folder on an XP machine (at least it is on the XP Virtual Machine that I have on my W7-64 computer. Really? Do you have to do something to activate it? When I installed Vista on my computer a few months ago, (I could be wrong about this... old age and all<g) I am almost positive that I looked to see if I could add the DatePicker control to a UserForm and couldn't until after I installed my copy of the compiler version of VB6. -- Rick (MVP - Excel) |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 22 Mar 2010 19:22:20 -0000, "Peter T" <peter_t@discussions wrote:
Which version of Mscomct2.ocx do you have, which contains the DTPicker. If not 6.1.98.16 see here and install the latest http://support.microsoft.com/kb/957924 Regards, Peter T I have an older version of that file. OTOH, my OS is not listed in the "applies to" portion of the MSKB article. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
user form start field | Excel Programming | |||
Basic user form question - hjow to write to a text field | Excel Programming | |||
Date field in user form & Loading a user form on opening workbook | Excel Programming | |||
formula behind field on user form | Excel Programming | |||
user form, field split??? | Excel Programming |