+ Reply to Thread
Results 1 to 7 of 7

Switching between workbooks,

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Basingstoke
    MS-Off Ver
    Excel 2007
    Posts
    4

    Switching between workbooks,

    From 1 workbook, I'm trying to open a 2nd workbook and then copy a value from this and paste it into the 1st. The code below is opening and selecting the right sheet but it doesn't copy the value from the 2nd workbook.

    Any help would be greatly appreciated.


    Please Login or Register  to view this content.
    Last edited by Katharine Evans; 09-24-2014 at 03:33 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Switching between workbooks,

    It looks like the code with only transfer the last value for PONumber1. Without the example workbook, its difficult to see what this might be - could it be a blank?
    Martin

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Basingstoke
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Switching between workbooks,

    Thanks Martin,

    PONumber1 definitely has a value, the problem seems to be copying data from Workbook1. The workbook opens but can't select, copy or paste into it.

    This is my first post, is it possible to upload the example workbook?

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Switching between workbooks,

    Go to advanced and there is a file upload mechanism available.

  5. #5
    Registered User
    Join Date
    10-18-2012
    Location
    Basingstoke
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Switching between workbooks,

    Thanks Martin. Here are the 2 workbooks.
    Attached Files Attached Files

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Switching between workbooks,

    Is workbook1 locked for editing? Can you try opening it as readonly?

  7. #7
    Registered User
    Join Date
    10-18-2012
    Location
    Basingstoke
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Switching between workbooks,

    Workbook1 is definitely not locked. I appreciate you confirming that the code looks OK.

    I think we've figured out the problem; it appears that a setting has been changed which is affecting how ActiveX buttons work. When we assign the code to a Form Control button it works, when it's assigned to an ActiveX Control button it doesn't. We're still not sure exactly why this is happening (maybe it could have something to do with a recent software update) but at least we've got the code working now.

    Thanks again for looking into this for me.

+ 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. Switching between Workbooks
    By voro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2012, 10:33 AM
  2. Switching between two workbooks
    By Monkeyboyz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2010, 07:01 AM
  3. Switching between workbooks
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2010, 09:07 AM
  4. switching between workbooks
    By dabith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2006, 07:45 PM
  5. Switching between workbooks
    By Jim in forum Excel General
    Replies: 3
    Last Post: 05-06-2005, 12:06 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