+ Reply to Thread
Results 1 to 3 of 3

Import worksheet add-in?

  1. #1
    Registered User
    Join Date
    04-30-2007
    Location
    JerseyCI/London
    Posts
    35

    Import worksheet add-in?

    Hi All

    I found this script on the net which I think is very good for importing multiple workbooks/worksheets into a current workbook.

    It works fine when running as a module, but when I change it become an add-in it gets a bit a confused when trying to move sheets.

    I'm pretty sure its something to do with the way thisworkbook is referenced. From some of the suggestions I see it could fixed by setting-up a class module, but it sounds like i'd have to do that for every workbook i wish to import worksheets into.

    Unfortunately my coding experience is not good enough to come up with an answer at present. Any ideas how to append this?

    -----------

    Courtesy of erik.van.geit
    http://www.mrexcel.com/forum/showthread.php?t=157175

    Please Login or Register  to view this content.
    Last edited by l8sk8r; 10-07-2008 at 12:41 PM.
    /
    ----
    OOO

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    Thisworkbook object refers to the workbook containing the code being executed. I your case the addin.

    Instead you would normall use the ActiveWorkbook object.
    In this particular code you need to create a reference to the activeworkbook before opening another workbook, which would then become the active workbook.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-30-2007
    Location
    JerseyCI/London
    Posts
    35
    Cheers Andy! That's really useful to see this working. I tried to reference the activeworkbook previously but I must have made a mistake somewhere. Thanks for your 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. vba: group data from csv then import into worksheet
    By okay123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2008, 01:02 AM
  2. Replies: 8
    Last Post: 08-05-2008, 01:19 PM
  3. Resolving Weighted Average #Value error in worksheet
    By salmanjan in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2008, 07:22 PM
  4. Which is faster: data manipulation in an array or worksheet?
    By Peaceful4getFul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2007, 01:23 PM
  5. Import Specific Data from Another Excel Worksheet
    By NewExcelUser in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2006, 07:49 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