+ Reply to Thread
Results 1 to 5 of 5

Macro not running on workbook open...

  1. #1
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Macro not running on workbook open...

    Hello everyone....
    I have a macro that should run on start up i.e. opening of workbook but it doesn't ....can someone figure out where I am probably going wrong??
    Please Login or Register  to view this content.

    These are two functions----

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro not running on workbook open...

    The Workbook_Open sub should be in the ThisWorkbook module.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Macro not running on workbook open...

    Two Possibilities:-

    Macro may not be turned on while opening the file
    Event may be turned OFF

    Check this in immediate window

    In VBA press Ctrl+G and enter

    Please Login or Register  to view this content.
    Press Enter and if it shows False then enter this to turn it ON

    Please Login or Register  to view this content.
    Press enter and close the file and reopen it and check

    Edit:-
    I have not seen your workbook at all lol


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Macro not running on workbook open...

    Hi sourabh,

    The Event code must be behind the workbook module. I've move it there. Read about event code and module differences at:
    http://www.cpearson.com/excel/Events.aspx
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Macro not running on workbook open...

    Thanks a lot to all of you ....I tried shifting the code to another module as I knew it had to be somewhere else...but forgot that it had to placed in this workbook...
    Thanks a lot....

+ 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. Running macro in another open workbook
    By prefix in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-02-2010, 09:02 AM
  2. running a macro on open of workbook
    By fluffy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2008, 09:46 AM
  3. Running macro on open of workbook?
    By Lime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2006, 01:45 PM
  4. macro not running on workbook open
    By Nick Smith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-11-2006, 05:30 AM
  5. [SOLVED] Running a macro in a open as read-o Workbook
    By TBarreiro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2005, 11: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