1

I an using the

range.copy(Destination:= <destination>) 

method in VB.Net

I know this function works if you want to copy to a different Sheet, But for some reason I can not find the right syntax to copy to a completely different Excel file

3
  • Please check this question stackoverflow.com/questions/19167939/… Commented Oct 4, 2013 at 13:31
  • possible duplicate of Is copy-and-paste coding ever acceptable? Commented Oct 4, 2013 at 13:31
  • 1
    I alreadyu found that question. However, that is VBA and the functions used there are not available in VB.Net This is most certainly not a duplicate of the second question. Im not asking wether or not I should copy my code, I am asking HOW to copy DATA from one workbook to another! Commented Oct 4, 2013 at 13:32

1 Answer 1

1

Do you have two different workbooks open?

Dim wbXLsource As Excel.Workbook
Dim wbXLtarget As Excel.Workbook

wbXLsource = appXL.Workbooks.Open(strFileNameAndPath)
wbXLtarget = appXL.Workbooks.Add

Got this code from this post

Here is another useful link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.