Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Can't get the popup calendar to work when I protect the workbook

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can't get the popup calendar to work when I protect the workbook

Is your worksheet protected (with that cell unlocked).

The "unlockedness" of the cell means that you can change the value, but you may
not be able to change the formatting (including the .numberformat).

Patty wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Can't get the popup calendar to work when I protect the workbook

Yes. The worksheet is protected with this cell unlocked. How do I prevent
the run-time error?
--
Patty


"Patty" wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can't get the popup calendar to work when I protect the workbook

Add a line to unprotect the sheet, do the work, and then add a line to reprotect
the sheet.

activesheet.unprotect password:="TopSecret"
with activecell
.numberformat = "mm/dd/yy"
.value = calendar1.value
end with
activesheet.protect password:="TopSecret"



Patty wrote:

Yes. The worksheet is protected with this cell unlocked. How do I prevent
the run-time error?
--
Patty

"Patty" wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Can't get the popup calendar to work when I protect the workbo

The password for my workbook is 'X'. I inserted the code you gave me, but
probably not in the right place because it still doesn't work.

Can you arrange properly for me so I can just copy and paste?

Here is what I have now:
Private Sub Calendar1_Click()
ActiveSheet.Unprotect Password:="X"
With ActiveCell
..NumberFormat = "mm/dd/yy"
..Value = Calendar1.Value
End With
ActiveSheet.Protect Password:="X"
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub
--
Patty


"Dave Peterson" wrote:

Add a line to unprotect the sheet, do the work, and then add a line to reprotect
the sheet.

activesheet.unprotect password:="TopSecret"
with activecell
.numberformat = "mm/dd/yy"
.value = calendar1.value
end with
activesheet.protect password:="TopSecret"



Patty wrote:

Yes. The worksheet is protected with this cell unlocked. How do I prevent
the run-time error?
--
Patty

"Patty" wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can't get the popup calendar to work when I protect the workbo

Private Sub Calendar1_Click()
ActiveSheet.Unprotect Password:="X"
With ActiveCell
.NumberFormat = "mm/dd/yy"
.Value = Calendar1.Value
End With
ActiveSheet.Protect Password:="X"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

Patty wrote:

The password for my workbook is 'X'. I inserted the code you gave me, but
probably not in the right place because it still doesn't work.

Can you arrange properly for me so I can just copy and paste?

Here is what I have now:
Private Sub Calendar1_Click()
ActiveSheet.Unprotect Password:="X"
With ActiveCell
.NumberFormat = "mm/dd/yy"
.Value = Calendar1.Value
End With
ActiveSheet.Protect Password:="X"
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub
--
Patty

"Dave Peterson" wrote:

Add a line to unprotect the sheet, do the work, and then add a line to reprotect
the sheet.

activesheet.unprotect password:="TopSecret"
with activecell
.numberformat = "mm/dd/yy"
.value = calendar1.value
end with
activesheet.protect password:="TopSecret"



Patty wrote:

Yes. The worksheet is protected with this cell unlocked. How do I prevent
the run-time error?
--
Patty

"Patty" wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Can't get the popup calendar to work when I protect the workbo

It works beautifully. Thanks a million!
--
Patty


"Dave Peterson" wrote:

Private Sub Calendar1_Click()
ActiveSheet.Unprotect Password:="X"
With ActiveCell
.NumberFormat = "mm/dd/yy"
.Value = Calendar1.Value
End With
ActiveSheet.Protect Password:="X"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

Patty wrote:

The password for my workbook is 'X'. I inserted the code you gave me, but
probably not in the right place because it still doesn't work.

Can you arrange properly for me so I can just copy and paste?

Here is what I have now:
Private Sub Calendar1_Click()
ActiveSheet.Unprotect Password:="X"
With ActiveCell
.NumberFormat = "mm/dd/yy"
.Value = Calendar1.Value
End With
ActiveSheet.Protect Password:="X"
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub
--
Patty

"Dave Peterson" wrote:

Add a line to unprotect the sheet, do the work, and then add a line to reprotect
the sheet.

activesheet.unprotect password:="TopSecret"
with activecell
.numberformat = "mm/dd/yy"
.value = calendar1.value
end with
activesheet.protect password:="TopSecret"



Patty wrote:

Yes. The worksheet is protected with this cell unlocked. How do I prevent
the run-time error?
--
Patty

"Patty" wrote:

I have the following code in my workbook to bring up a calendar.
Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy"
End Sub
Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

When I choose a date on the calendar, I get the following message:
Run-time error '1004'
Unable to set the NumberFormat property of the range class

If I choose End, the date appears in the cell.

I want to publish this form on our website and don't want this message to
appear. It only happens when I protect the worksheet. The date cell is
unlocked.

How do I fix?
--
Patty

--

Dave Peterson


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup calendar GerryK Excel Discussion (Misc queries) 1 April 4th 07 07:14 PM
Protect Workbook Vs Protect Sheet Poor_pakistani New Users to Excel 4 May 25th 06 02:06 PM
calendar popup Aaron Excel Discussion (Misc queries) 1 May 11th 06 02:52 PM
Workbook Popup note Carolan Excel Worksheet Functions 2 February 9th 06 07:49 PM
popup calendar with multiple months shawn Excel Discussion (Misc queries) 0 December 28th 05 02:55 AM


All times are GMT +1. The time now is 01:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"