Calendar Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I had the calendar control with the macro in my workbook template
I since taken the macro code out. The problem I'm having is that now once
new workbook is saved from this template, if someone opens it wit
their macro security set on high, a large calendar appears in the worksheet and
I can never get rid of it
I'm guessing that when I inserted the object, Calendar Control it is still in tha
workbook somewhere
Is there anyway to stop this from happening

Thanks
 
Here's a "shape deleter".
It shows a list of Shapes for the active worksheet and allows you to select
which ones you want to delete.
You delete the selected shapes by clicking the button.

Here's how to set it up.

From Visual Basic Editor, Create a new UserForm and add a ListBox and a
CommandButton

Use the following for the UserForm code:

Private Sub UserForm_Initialize()
Fill_ListBox
End Sub

Private Sub Fill_ListBox()
Dim shp As Shape

ListBox1.Clear
ListBox1.MultiSelect = fmMultiSelectMulti
For Each shp In ActiveSheet.Shapes
ListBox1.AddItem shp.Name
Next
End Sub

Private Sub CommandButton1_Click()
Dim i As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then ActiveSheet.Shapes(.List(i)).Delete
Next
End With
Fill_ListBox
End Sub
 
Rob I tried it but I get error at
If .Selected(i) Then ActiveSheet.Shapes(.List(i)).Delet
Next
 

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

Back
Top