Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Guv Guv is offline
external usenet poster
 
Posts: 2
Default How to disable activex controls & code on saving a new workbook.XL2003

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to disable activex controls & code on saving a new workbook.XL2003

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.E nabled = False
'or
ThisWorkbook.Worksheets("sheet1").CommandButton1.V isible = False
'or
ThisWorkbook.Worksheets("sheet1").CommandButton1.C ut



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
  #3   Report Post  
Posted to microsoft.public.excel.programming
Guv Guv is offline
external usenet poster
 
Posts: 2
Default How to disable activex controls & code on saving a new workbook.XL2003

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to disable activex controls & code on saving a new workbook.XL2003

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
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
I need help deleting macros and VB controls and saving as new workbook [email protected] Excel Programming 4 October 5th 06 08:31 PM
Distribute Excel workbook with ActiveX controls. zhang xu[_2_] Excel Programming 0 June 23rd 06 07:14 PM
Saving Excel with ActiveX controls Roopa New Users to Excel 0 February 9th 05 06:35 PM
[HELP] This workbook has lost its VBA Project, ActiveX Controls and any other program bigstyle Excel Programming 1 March 2nd 04 12:26 AM
ActiveX message XL2003 Reinhard Thomann Excel Programming 2 January 16th 04 09:01 PM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"