+ Reply to Thread
Results 1 to 3 of 3

Workbook_Open Procedures

  1. #1
    Registered User
    Join Date
    03-29-2014
    Location
    Portugal
    MS-Off Ver
    Excel 2013
    Posts
    73

    Workbook_Open Procedures

    I am trying to call on 2 separate procedures on the same workbook like so

    Private Sub Workbook_Open()
    Protect_Me
    End Sub
    _______________________
    Private Sub Workbook_Open()
    frmLogin.Show
    End Sub

    I get a compile error, I think it has to do with both Sub's having the same name..... I tried renaming the frmLogin Sub, and it will not call the form, If I rename the Protect_Me Sub, it will interfere with the vba code on that Macro and will not let me run some other macros on the workbook unless I unlock the sheet manually, which is not what I would like to do. Keeping the name as is on the Protect_Me Sub, the macros run just as they should on the sheet.

    How do I get around this problem?

    Thanking you all in advance...

    Cheers
    Tony

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Workbook_Open Procedures

    I'm not sure I follow what you want, but how about this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-29-2014
    Location
    Portugal
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Workbook_Open Procedures

    That's exactly that

    Thanks a lot AlphaFrog

+ 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. Functions, procedures and sub procedures - when to choose what?
    By tiwas in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-01-2015, 09:00 AM
  2. [SOLVED] My procedures take too long to run...
    By jeremyfox36 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2014, 10:24 AM
  3. Private sub workbook_open code running workbook_open code from other project
    By marshall_massive in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 06:07 PM
  4. Repetitive procedures
    By JohnDoe2010 in forum Excel General
    Replies: 0
    Last Post: 07-08-2011, 09:54 AM
  5. VBA Sub Procedures
    By ladeda063610 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2008, 03:12 AM
  6. Updating workbook_open from workbook_open
    By tonywig in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2007, 07:39 AM
  7. Get VBA procedures from DB
    By Hiran de Silva in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2006, 12:50 PM

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