PC Review


Reply
Thread Tools Rate Thread

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

 
 
Guv
Guest
Posts: n/a
 
      25th Feb 2008
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.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      25th Feb 2008
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



Guv wrote:
>
> 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.


--

Dave Peterson
 
Reply With Quote
 
Guv
Guest
Posts: n/a
 
      26th Feb 2008
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.

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th Feb 2008
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

Guv wrote:
>
> 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.


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Distribute Excel workbook with ActiveX controls. =?Utf-8?B?emhhbmcgeHU=?= Microsoft Excel Programming 0 23rd Jun 2006 07:14 PM
THE WORKBOOK HAS LOST ITS VBA project, activeX controls and any o. =?Utf-8?B?amxkb3Zl?= Microsoft Excel Crashes 0 7th Mar 2005 06:39 PM
Saving Excel with ActiveX controls =?Utf-8?B?Um9vcGE=?= Microsoft Excel New Users 0 9th Feb 2005 06:35 PM
[HELP] This workbook has lost its VBA Project, ActiveX Controls and any other program bigstyle Microsoft Excel Programming 1 2nd Mar 2004 12:26 AM
[HELP] This workbook has lost its VBA Project, ActiveX Controls and any other program bigstyle Microsoft Excel Misc 1 1st Mar 2004 05:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 PM.