Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Error in Calendar tool - Compile Error

Hi

I have been changing some thing in excel so that my calendar tool dosent
work any more. I get the error message: "Compile Error - User-defined type
not defined" when I open an emthy sheet and the debugger stops at:

PERSONAL.XLS:

Private Sub Workbook_Open()

= Dim NewControl As CommandBarControl

' Assign shortcut to display calendar on SHIFT+CTRL+C
Application.OnKey "+^{C}", "Module1.OpenCalendar"
' Add item to shortcut menu on open
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
On Error GoTo 0
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
End Sub

Any suggestions of how to make this work again would be much appriciated?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default Error in Calendar tool - Compile Error

That compile error is consistence with having removed the reference to the
Microsoft Office object. Tools, References in the VBE.

--
Jim
"Steen" wrote in message
...
| Hi
|
| I have been changing some thing in excel so that my calendar tool dosent
| work any more. I get the error message: "Compile Error - User-defined type
| not defined" when I open an emthy sheet and the debugger stops at:
|
| PERSONAL.XLS:
|
| Private Sub Workbook_Open()
|
| = Dim NewControl As CommandBarControl
|
| ' Assign shortcut to display calendar on SHIFT+CTRL+C
| Application.OnKey "+^{C}", "Module1.OpenCalendar"
| ' Add item to shortcut menu on open
| On Error Resume Next
| Application.CommandBars("Cell").Controls("Insert Date").Delete
| On Error GoTo 0
| Set NewControl = Application.CommandBars("Cell").Controls.Add
| With NewControl
| .Caption = "Insert Date"
| .OnAction = "Module1.OpenCalendar"
| .BeginGroup = True
| End With
| End Sub
|
| Any suggestions of how to make this work again would be much appriciated?


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
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile error in hidden module error Melissa Zebrowski Excel Programming 3 February 20th 04 01:29 PM


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

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

About Us

"It's about Microsoft Excel"