Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Spreadsheet keeps duplicating drawn lines. | Excel Discussion (Misc queries) | |||
Finding the column which a value was drawn from | Excel Discussion (Misc queries) | |||
Drawn Object Woes | Excel Programming | |||
How to remove a drawn chart object using VBA. | Excel Programming | |||
Prevent User from Deleting Drawn Object | Excel Programming |