How to disable activex controls & code on saving a new workbook.XL2003

  • Thread starter Thread starter Guv
  • Start date Start date
G

Guv

Please can anyone help me?
I have created a form that uses activex controls and some code. The
form is then saved as a read only file and some cells in the range are
pasted as values.
I know the form is read only but I would like to disable the controls
and code purely to keep the read only "clean".
I am very green using VBA so any help would be appreciated.
Thanks, Guv.
 
If you're using code to do the copy|paste special|values and saveAs, maybe you
can add something to the code to disable, hide or delete the object.

Maybe something like one of these:

ThisWorkbook.Worksheets("sheet1").CommandButton1.Enabled = False
'or
ThisWorkbook.Worksheets("sheet1").CommandButton1.Visible = False
'or
ThisWorkbook.Worksheets("sheet1").CommandButton1.Cut
 
Thanks Dave, I have already done this, but I was hoping for one
procedure to disable all, as there are many controls etc.

Thanks, Guv.
 
Are there any OLEObjects that you want to keep active?

Maybe you could use a variation of:

dim OLEObj as OLEObject
for each oleobj in worksheets("sheet999").oleobjects
oleobj.object.enabled = false
next oleobj
 
Back
Top