+ Reply to Thread
Results 1 to 9 of 9

Enabling Macros

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    Sherwood Park, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Enabling Macros

    I recently reformatted my hard drive. When I re-installed Office 2007, I was unable to run a Workbook that has a Macro in it. First, I went to Add-ins and added the Solveradd-in. When I opened the workbook, I enabled Macros. However, all I get is a maessage saying that the MVB did not compile. I know there are some things you have to do to solve this, but I cannot remember the procedure I went thru 2 years ago to get this to work. Does anyone know what steps I must take?

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Enabling Macros

    a maessage saying that the MVB did not compile
    can you post the exact error message?

  3. #3
    Registered User
    Join Date
    02-09-2010
    Location
    Sherwood Park, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Enabling Macros

    Micosoft Visual Basic
    Compile error:
    Sub or Function not defined.
    On the Module1 (Code), the following:

    Please Login or Register  to view this content.
    Last edited by teylyn; 02-11-2010 at 05:43 AM. Reason: added code tags

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Enabling Macros

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I'll add the code tags for you this time, but I'll expect you to use them from now on.

    What line does the error occur on? Whatever happened to the "MVB did not compile" error you listed in your first post? Where does that come in?

    Can you state exactly what error you get and which line it occurs on?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Enabling Macros

    You will need to set a Reference to Solver in VBE, see: http://peltiertech.com/Excel/SolverVBA.html

  6. #6
    Registered User
    Join Date
    02-09-2010
    Location
    Sherwood Park, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Enabling Macros

    Is there a way to attach the file i AM TRYING TO RUN?

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Enabling Macros

    You can upload a file by clicking "Go Advanced" below the Quick Reply box and then the paper clip icon.

  8. #8
    Registered User
    Join Date
    02-09-2010
    Location
    Sherwood Park, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Enabling Macros

    This is the file I am trying to run. When I run it, it goes to a page that shows the Module1 Code that I copied and posted previously. It also has a small box that contains the information I showed at the top of the last post. It reads"Microsoft Visual Basic Compile error: Sub or Function not defined. New dehycalc1.xlsm-Module1(Code)"
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-09-2010
    Location
    Sherwood Park, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Smile Re: Enabling Macros

    Even though the article you referenced was for the older versions of Excel, I was able to figure out what to do in Excel 2007. There is no "Tool" Menu in 2007. Instead, you go to the Logo Button in the top left and click the Excell Options Button. Then you go to Add-ins and add Solver.
    You then need to activate Microsoft Visual Basic and follow the rest of your directions. I got to MVB by Editting the Macro.
    Thanks for the help. The problem is solved.

+ 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