+ Reply to Thread
Results 1 to 4 of 4

issue reading from another workbook.

  1. #1
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    issue reading from another workbook.

    I'm trying to read information from another workbook, workbook a has a userform i click a button and the ideal scenario i want is it to read from workbook b.

    I started by implementing reading from current sheet 2
    Please Login or Register  to view this content.
    and this worked fine but it was on the same workbook, so now I tried to implement reading from another workbook but I'm having no luck. I tried to get it to open another book with screenupdating off and read that contents with same kind of functions but I keep on being prompted with the vb error I put in place.

    Please Login or Register  to view this content.
    anyone know where I'm going wrong to get it to read from a closed workbook, bare in mind first code works from current sheet and second is an attempt to read from the sheet I'm after. The information on the new sheet in sheet1 not sheet 2 like the current document btw

    Any help appreciated

    K
    Last edited by kieranbop; 10-20-2011 at 04:19 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: issue reading from another workbook.

    Please Login or Register  to view this content.

    ThisWorkbook will always refer to the workbook that contains the code.

    I think you would need:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: issue reading from another workbook.

    Re-written a little:

    Please Login or Register  to view this content.

    Dom

  4. #4
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Re: issue reading from another workbook.

    thanks for that dom, works perfectly how I need it now.
    Last edited by kieranbop; 10-20-2011 at 04:19 AM.

+ 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