Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Remove buttons from worksheet programmatically

Hi.

I have a number of worksheets that I copy to a new workbook. These
worksheets have a number of command buttons. I would like to remove these
buttons after copying. Is this possible with VBA?


Thanks.

Albert

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Remove buttons from worksheet programmatically

Try this Albert:

'====================
Sub DeleteAllButtons()

Dim mySheet As Worksheet
Dim MyButton As OLEObject

For Each mySheet In ActiveWorkbook.Worksheets

For Each MyButton In mySheet.OLEObjects
If TypeOf MyButton.Object Is MSForms.CommandButton Then
MyButton.Delete
End If
Next MyButton

Next mySheet

End Sub
'====================




On 11 Sep, 12:20, "Albert Browne" wrote:
Hi.

I have a number of worksheets that I copy to a new workbook. These
worksheets have a number of command buttons. I would like to remove these
buttons after copying. Is this possible with VBA?

Thanks.

Albert


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
Remove macro programmatically [email protected] Excel Programming 2 September 4th 08 04:48 PM
Remove missing reference programmatically Nacho Nachev Excel Programming 1 October 4th 04 12:19 PM
How to programmatically remove an AddIn (xla) AndyB Excel Programming 1 July 6th 04 06:38 AM
Programmatically remove sharing? Anson[_2_] Excel Programming 0 June 14th 04 08:11 PM
Programmatically adding buttons to a worksheet (Shape Object) Phil Excel Programming 3 January 26th 04 03:51 PM


All times are GMT +1. The time now is 03:33 PM.

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"