+ Reply to Thread
Results 1 to 4 of 4

Call a macro from your personal workbook?

Hybrid View

Macdave_19 Call a macro from your... 05-30-2008, 08:01 AM
dgtvr put the following code into... 05-30-2008, 08:50 AM
Macdave_19 cheers really no need for... 05-30-2008, 08:52 AM
dgtvr Actually the code that I... 05-30-2008, 02:17 PM
  1. #1
    Registered User
    Join Date
    04-30-2008
    Posts
    14
    put the following code into the ThisWorkbook file that is on the left hand side in VBA with the little excel icon.

    Sub Workbook_Open()

    Workbooks("sample.xls").Activate
    ActiveWorkbook.Close
    Workbooks.Open Filename:="c:\sample.xls"

    End Sub

  2. #2
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Thumbs up

    cheers

    really no need for the "little excel icon" part lol i know me way around by now lol

    thanks for the help dude!!!! my code was similar to this!!
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  3. #3
    Registered User
    Join Date
    04-30-2008
    Posts
    14
    Actually the code that I wrote earlier was a bit specific. It would activate when you open the initial workbook. However, the body of the code is the same if you want to use the procedure in a module.


    Sub ThisModuleClosesAndReopensAnotherWorkbook()

    Workbooks("sample.xls").Activate
    ActiveWorkbook.Close
    Workbooks.Open Filename:="c:\sample.xls"

    End Sub

+ 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