Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Delete a Commandbutton from another Workbook

Dear All,

What code do I use to reference and then delete a commandbutton that is
embedded on a worksheet in workbook(B).
The code has to go in a module in workbook(A).

Any help greatly appreciated
Jason

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete a Commandbutton from another Workbook

Hi jase

If the workbook is open you can use this for a control toolbox button

Workbooks("OtherWorkbook.xls").Sheets("Sheet1").OL EObjects("TheButton").Delete


--
Regards Ron de Bruin
http://www.rondebruin.nl



"jase" wrote in message oups.com...
Dear All,

What code do I use to reference and then delete a commandbutton that is
embedded on a worksheet in workbook(B).
The code has to go in a module in workbook(A).

Any help greatly appreciated
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Delete a Commandbutton from another Workbook

cheers Ron

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Delete a Commandbutton from another Workbook

so the OLEObjects collaction comprises all things embedded in
worksheets?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Delete a Commandbutton from another Workbook

Nope. For instance, you can add controls from the Forms toolbar or shapes from
the Drawing toolbar. These aren't OLEObjects.

jase wrote:

so the OLEObjects collaction comprises all things embedded in
worksheets?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete a Commandbutton from another Workbook

to complement Dave's thought - all the items on the worksheet are in the
shapes collection.

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
Nope. For instance, you can add controls from the Forms toolbar or shapes

from
the Drawing toolbar. These aren't OLEObjects.

jase wrote:

so the OLEObjects collaction comprises all things embedded in
worksheets?


--

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
CommandButton to open a Excel workbook aussiegirlone Excel Discussion (Misc queries) 2 March 25th 09 01:34 AM
Delete Forms CommandButton on Worksheet Jim May Excel Discussion (Misc queries) 7 June 5th 06 10:29 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do I delete a workbook after the vba has run? Patrick Excel Programming 1 January 28th 05 04:17 PM
Close WorkBook with CommandButton Rockee052[_50_] Excel Programming 3 February 23rd 04 04:04 AM


All times are GMT +1. The time now is 09:13 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"