Results 1 to 7 of 7

Thread: VBA to Copy Data From Other Workbooks Suddenly Fails

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    It's got to do with the difference between ActiveWorkbook and ThisWorkbook.

    ThisWorkbook always refers to the workbook file wherein the code is running from. If you change ThisWorkbook, to ActiveWorkbook, the code should run from the personal.xlsb file too.

    ThisWorkBook object refers to the workbook that the code is contained in. ActiveWorkBook object refers to the workbook that is currently active.

    Most times, they will refer to the same workbook. But if the workbook running the code is not the active workbook then they will point to different objects.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Junior Member
    Join Date
    Jul 2013
    Posts
    12
    Rep Power
    0
    Thank you very much guys. Your prompt and helpful responses helped immensely. I'm still new to all this and I appreciate all your help.

    I'm not sure how to set this thread as [SOLVED], unless that's not needed.

    - Amit

Similar Threads

  1. Replies: 2
    Last Post: 05-28-2013, 05:32 PM
  2. Replies: 3
    Last Post: 05-14-2013, 03:25 PM
  3. Form suddenly disappears
    By tfurnivall in forum Access Help
    Replies: 3
    Last Post: 12-20-2012, 06:47 PM
  4. Replies: 2
    Last Post: 11-08-2012, 01:15 PM
  5. VBA Code to Open Workbook and copy data
    By Howardc in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 06:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •