+ Reply to Thread
Results 1 to 5 of 5

Macro to load another workbook

  1. #1
    Forum Contributor
    Join Date
    08-14-2016
    Location
    Warrington, England
    MS-Off Ver
    MS 365
    Posts
    168

    Macro to load another workbook

    Hi all,

    I have a macro which is designed to open another spreadsheet in order for formula in another spreadsheet to read from it. The macro I have works, it opens the file and my formula all work however the macro still debugs every time on the open workbook line even though it has actually found and opened the file!

    Can anyone assist and help? The debug message is: Run Time Error 1004 - Unable to set the hidden property of the range class

    Many thanks in advance!

    Please Login or Register  to view this content.

  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 to load another workbook

    Is there any code in the workbook you are opening that is triggered when the file is opened?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    08-14-2016
    Location
    Warrington, England
    MS-Off Ver
    MS 365
    Posts
    168

    Re: Macro to load another workbook

    It is someone elses worksheet which unfortunately I don't have complete access to however once i saw your comment i dug around a bit further and found that you were right, the sheet i am loading is trying to run a macro when it opens which itself does not work! this is causing mine to debug, so problem found! at least it wasn't anything wrong with my code haha.

    Is there any way I can get around the Debug? Such as a macro to select 'End' or something so it actually runs right to the end because the macro itself has worked and the file has loaded!

    Any tricks?

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

    Re: Macro to load another workbook

    What you could do is disable events, open the other workbook and then enable events again.

    Something like this.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-14-2016
    Location
    Warrington, England
    MS-Off Ver
    MS 365
    Posts
    168

    Re: Macro to load another workbook

    Brilliant! That has worked perfectly! Thanks for the help!

+ 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. Run Type Error 424: Macro to load data from a different workbook
    By SGraber in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-30-2013, 05:39 PM
  2. [SOLVED] Load form when workbook opens
    By anna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2006, 06:25 PM
  3. How to load/show UserForm from other Workbook
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2006, 08:30 AM
  4. Replies: 2
    Last Post: 07-18-2006, 10:35 PM
  5. Userform to load when Workbook is opened
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2006, 09:45 AM
  6. auto load data from one workbook to another
    By jmw in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2006, 09:25 AM
  7. Load forms from another workbook
    By Jason Zischke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2006, 10:30 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