thechazm
New Member
- Joined
- Mar 26, 2013
- Messages
- 14
It seems there is a problem copying from one excel applications worksheet to another excel applications worksheet through vba. I am opening two excel applications (not the same instance) and am trying to copy a single range of just values no formats and I keep getting errors. I have narrowed it down to it being two seperate excel applications but how can I overcome this problem? I can get this to work if I open the other workbook in the same excel instance but not if it is a seperate one. Below is experimental code:
Opening in seperate instance copying a range but converts even though only using .value
Opening it in the same instance I can get it to copy using the copy function that does not convert values (like numbers to dates or whatever)
If anyone could shed some light on this for me I would greatly appreciate it. Also as a side note I notice when you use the .value to copy over the data it also copies any named ranges if the range in the remote worksheet had a named range into the original one :/
I thought the .value just pulls over the value but it's not.
Thanks
Opening in seperate instance copying a range but converts even though only using .value
Code:
xlsModify.Range("A1").Value = xlsRemoteSheet.Range("A1:AL1").Value
Opening it in the same instance I can get it to copy using the copy function that does not convert values (like numbers to dates or whatever)
Code:
xlsRemoteSheet.Name.Range("A1:AL1").Copy xlsModify.Name.Range("B1")
If anyone could shed some light on this for me I would greatly appreciate it. Also as a side note I notice when you use the .value to copy over the data it also copies any named ranges if the range in the remote worksheet had a named range into the original one :/
I thought the .value just pulls over the value but it's not.
Thanks
Last edited: