J
JayWangTPE
Guest
Hi
In VB.NET, when I do copy something in excel file1 and paste it to another excel file2 in many times.
Sometimes (not always), the following exception happens. How can I fix it? Thanks in advance.

xlRange1.Copy() ' copy from excel file 1
'
ws.Activate()
Call WaitMs(100)
'
xlRange2 = ws.Range(PastLoc).Offset(, pasteColumnNo)
'Call WaitMs(100)' To paste in excel file 2
xlRange2.PasteSpecial(Excel.XlPasteType.xlPasteValues, Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, vbFalse, vbFalse)
Continue reading...
In VB.NET, when I do copy something in excel file1 and paste it to another excel file2 in many times.
Sometimes (not always), the following exception happens. How can I fix it? Thanks in advance.

xlRange1.Copy() ' copy from excel file 1
'
ws.Activate()
Call WaitMs(100)
'
xlRange2 = ws.Range(PastLoc).Offset(, pasteColumnNo)
'Call WaitMs(100)' To paste in excel file 2
xlRange2.PasteSpecial(Excel.XlPasteType.xlPasteValues, Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, vbFalse, vbFalse)
Continue reading...