+ Reply to Thread
Results 1 to 3 of 3

Removing Drawn Object

  1. #1
    Forum Contributor
    Join Date
    12-04-2003
    Location
    Burrton, Kansas USA
    MS-Off Ver
    2003
    Posts
    162

    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!

  2. #2
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    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

  3. #3
    Forum Contributor
    Join Date
    12-04-2003
    Location
    Burrton, Kansas USA
    MS-Off Ver
    2003
    Posts
    162
    Works Great Col!! Thanks for your time and help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1