Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Removing Drawn Object


Hello!

When I "Save As" to a new location, is there a code that would allow me
to remove a specified drawn object or control button?

I have a template workbook that the user can print instructions (word
document) from a button. After they "Save As" to whatever new location
they choose, the file path is no longer valid and I would like the
button to disappear.

Maybe there is a better way?

Thanks for any help or direction!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=548916

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Removing Drawn Object


Put:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

If SaveAsUI Then Sheet1.Shapes("CommandButton1").Delete

End Sub

in the ThisWorkbook code module of your workbook (substitute the
correct names for the sheet and commandbutton in question).

Or you could change the file path to a UNC path (i.e.
"\\servername\volume\directory\file")


Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=548916

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Removing Drawn Object


Works Great Col!! Thanks for your time and help!

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=54891

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
Spreadsheet keeps duplicating drawn lines. AECLP Excel Discussion (Misc queries) 2 August 14th 08 10:44 PM
Finding the column which a value was drawn from skier464 Excel Discussion (Misc queries) 5 September 10th 06 03:11 AM
Drawn Object Woes Brian Matlack[_46_] Excel Programming 2 January 16th 06 07:58 PM
How to remove a drawn chart object using VBA. Raas Excel Programming 3 November 22nd 05 04:04 PM
Prevent User from Deleting Drawn Object Tod Excel Programming 4 July 23rd 04 09:59 AM


All times are GMT +1. The time now is 11:34 AM.

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"