Need more help.....getting error on pop-up calendar

G

Guest

In searching the posting for this user group, I found what I needed to create
a pop-up calendar in my workbook. It works fine........up to a point. When I
share the workbook I get an error message. I'm not a VBA person and wondered
if someone could offer assistance with troubleshooting the error message.

Here is the code I used to create the pop-up calendar

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("A1:A20"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
Else: Calendar1.Visible = False
End If
End Sub

Here is the error message I get when I share the workbook

Run-time error '1004': Unable to set the left property of the OLEObject class.

I remove this line and get the same error message unable to set "top"
I removed this line also and it works but when you scroll to bottom of the
worksheet then you can't see the caldendar when it pops up.

Any help would be much appreciated. Thanks!
 
D

Dave Peterson

Your code worked ok for me.

I downloaded the mscal.ocx from http://www.fontstuff.com/vba/vbatut07.htm and
registered it on my pc and it worked nicely.

I saved my workbook, closed excel and unregistered the mscal.ocx from my pc.

When I reopened excel, that calendar was a placeholder--the code blew up with a
variable not defined error.

I was hoping that it was a registry problem.

Not any help, but your post looked very lonely.
 
G

Guest

Thanks Dave,
I was feeling pretty a lone with no responses. :)

Thanks for trying. I'm not any further than I was yesterday. Even tried
doing a goggle search on VBA errors without any luck.
 
D

Dave Peterson

Ahhhhhhh!

I missed this line in your post:
"Here is the error message I get when I share the workbook"

If you go into excel's help, you can search for "Features that are unavailable
in shared workbooks"

There are lots of them--including...

Unavailable feature Alternatives
Insert or change pictures You can view existing pictures and objects.
or other objects

And when I shared my workbook, I got that same error.

sorry for missing that line yesterday!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top