![]() |
Excell cuts string when copying
Hi All I have problem with copy paste using VBA. I have a worksheet and its filled with some data. There is also a button that creates another worksheet ad copy some range to the new worksheet I am using the following code : Dim objExcel As Excel.Application Set objExcel = CreateObject("Excel.Application") objExcel.Workbooks.Add objExcel.Visible = False Worksheets("AD Request Form").Range("A1:W12").Copy objExcel.Range("A1:W12").PasteSpecial (xlPasteValues) The problem is that in some cells there is a lot of text. After copy paste in the new worksheet all strings are being cut to 255 char Is there some workarround Plz help it is very important to me BR, Krzysztof -- temp_for_oracle ------------------------------------------------------------------------ temp_for_oracle's Profile: http://www.excelforum.com/member.php...o&userid=25912 View this thread: http://www.excelforum.com/showthread...hreadid=392881 |
Excell cuts string when copying
Why are you creating another instance of Excel? Just use the current
instance and the text will not be truncated. -- Jim "temp_for_oracle" <temp_for_oracle.1t8qqj_1123160773.4379@excelfor um-nospam.com wrote in message news:temp_for_oracle.1t8qqj_1123160773.4379@excelf orum-nospam.com... | | Hi All | I have problem with copy paste using VBA. | | I have a worksheet and its filled with some data. There is also a | button that creates another worksheet ad copy some range to the new | worksheet | | I am using the following code : | | Dim objExcel As Excel.Application | Set objExcel = CreateObject("Excel.Application") | objExcel.Workbooks.Add | objExcel.Visible = False | Worksheets("AD Request Form").Range("A1:W12").Copy | objExcel.Range("A1:W12").PasteSpecial (xlPasteValues) | | | The problem is that in some cells there is a lot of text. | After copy paste in the new worksheet all strings are being cut to 255 | char | | Is there some workarround | Plz help it is very important to me | | | BR, | Krzysztof | | | -- | temp_for_oracle | ------------------------------------------------------------------------ | temp_for_oracle's Profile: http://www.excelforum.com/member.php...o&userid=25912 | View this thread: http://www.excelforum.com/showthread...hreadid=392881 | |
Excell cuts string when copying
Try this... Code: -------------------- Sub testRemove() Worksheets("AD Request Form").Range("A1:W12").Copy Workbooks.Add wsNew.Range("A1").PasteSpecial Cells.Calculate End Sub -------------------- Enjoy Excelling!!! ilyas... -- ilyaskazi ------------------------------------------------------------------------ ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969 View this thread: http://www.excelforum.com/showthread...hreadid=392881 |
All times are GMT +1. The time now is 04:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com