+ Reply to Thread
Results 1 to 4 of 4

Macro Button error ("user-defined type not defined")

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro Button error ("user-defined type not defined")

    Hi All,
    I'm a long time reader of the forum and now my first post. I generally find the solution to my macro requirements by searching the internet, this one has me looking for your help.

    I have a workbook with several sheets that I use on a daily basis, one sheet for each day of the week Monday To Sunday. Each sheet has several Macros . Sunday the workbook is saved, copied and the copy is renamed.
    The problem I have is, after the name change I then have to reassign macros to the buttons which really defeats the porpoise of having the buttons. The buttons where created using forms control and are strategically scattered throughout the sheets. The workbook name is "Daily Diary week Ending 15-05-16" . The workbook name change is the date
    I'm not very good at creating my own macros however I'm getting ok at changing others to suit my individual requirements. I considered recording a macro but it would be quite a long macro.

    Any ideas would be greatly appreciated.
    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,034

    Re: Macro Button error ("user-defined type not defined")

    Instead of saving, copying, and renaming, do this:

    Save the file with its current name ("Daily Diary week Ending 15-05-16"), then use File / Save As, using the new name ("Daily Diary week Ending 22-05-16") - and you're done. The macros will work fine. Then use the file as you would normally....
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro Button error ("user-defined type not defined")

    Thanks Heaps Bernie. Worked a treat and super simple.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,034

    Re: Macro Button error ("user-defined type not defined")

    Great - glad to hear that your problem is solved. Could you mark the thread Solved as well, so others will know?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 11-13-2015, 09:03 PM
  2. "User-defined type not defined"
    By jirakst in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2015, 11:13 AM
  3. Replies: 1
    Last Post: 05-06-2013, 06:07 AM
  4. Error message: "Compile error. User-defined type not defined"
    By freckles81 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-13-2012, 09:37 AM
  5. Error message: "Compile error. User-defined type not defined"
    By lottesfog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2007, 06:38 PM
  6. "User-defined type not defined" error when trying to send e-mail
    By SupperDuck in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-02-2006, 02:40 AM
  7. [SOLVED] "User-defined type not defined" message in Excel
    By RW1946 in forum Excel General
    Replies: 0
    Last Post: 08-31-2005, 08:05 AM

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