Results 1 to 20 of 24

Thread: Vba open workbook and paste from another workbook

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,970
    Try changing this line:
    owb = Application.Workbooks.Open(fpath & "\" & fname)
    to:
    Set owb = Application.Workbooks.Open(fpath & "\" & fname)

    also the following line may not work:
    Set rngPaste = Workbooks(DummyXXAC.xlsm).Sheets("Sheet1").Range("d2")
    so make it either:
    Set rngPaste = Workbooks("DummyXXAC.xlsm").Sheets("Sheet1").Range("d2")
    or:
    Set rngPaste = Workbooks(fname).Sheets("Sheet1").Range("d2")
    All untested.
    Last edited by p45cal; 02-21-2015 at 05:52 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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