O
Otto Moehrbach
Excel 2003, Win XP
I am helping an OP in Britain and he is getting an error with my code that I
am not getting on my machine. He has Excel 2002
Basically, the task at hand (at the point of the error) is a simple copy &
paste of the entries in an Invoice form to a single row on another sheet for
storage purposes.
The highlighted code is:
Dest(, 3).PasteSpecial Transpose:=True
The error message is a new one for me. It states:
Run-time error'-2147417848(80010108)
Automation error
The object invoked has disconnected from its clients.
Does anyone have any ideas as to what could be happening? Is it a UK thing?
Thanks for your help. Otto
The complete macro is:
Sub StoreInvoice()
Dim i As Range
Dim Dest As Range
Dim c As Long
With Sheets("Invoice Storage")
If .[A2] = "" Then
Set Dest = .[A2]
Else
Set Dest = .Range("A" & Rows.Count).End(xlUp)(2)
End If
Dest = [F15]
Dest(, 2) = [C9]
Range("C10:C13").Copy
Dest(, 3).PasteSpecial Transpose:=True 'Highlighted code
Dest(, 7) = [C15]
Dest(, 8) = [H15]
Dest(, 8).NumberFormat = "m/d/yyyy;@"
c = 2
For Each i In Range("LineRng")
i.Resize(, 7).Copy
Dest(, c + 7).PasteSpecial xlPasteValues
c = c + 7
Next i
[C30:C35].Copy
Dest(, 79).PasteSpecial Paste:=xlPasteValues, Transpose:=True
[E31:F31].Copy Dest(, 85)
[H30:H32].Copy
Dest(, 87).PasteSpecial Paste:=xlPasteValues, Transpose:=True
End With
Application.CutCopyMode = False
End Sub
I am helping an OP in Britain and he is getting an error with my code that I
am not getting on my machine. He has Excel 2002
Basically, the task at hand (at the point of the error) is a simple copy &
paste of the entries in an Invoice form to a single row on another sheet for
storage purposes.
The highlighted code is:
Dest(, 3).PasteSpecial Transpose:=True
The error message is a new one for me. It states:
Run-time error'-2147417848(80010108)
Automation error
The object invoked has disconnected from its clients.
Does anyone have any ideas as to what could be happening? Is it a UK thing?
Thanks for your help. Otto
The complete macro is:
Sub StoreInvoice()
Dim i As Range
Dim Dest As Range
Dim c As Long
With Sheets("Invoice Storage")
If .[A2] = "" Then
Set Dest = .[A2]
Else
Set Dest = .Range("A" & Rows.Count).End(xlUp)(2)
End If
Dest = [F15]
Dest(, 2) = [C9]
Range("C10:C13").Copy
Dest(, 3).PasteSpecial Transpose:=True 'Highlighted code
Dest(, 7) = [C15]
Dest(, 8) = [H15]
Dest(, 8).NumberFormat = "m/d/yyyy;@"
c = 2
For Each i In Range("LineRng")
i.Resize(, 7).Copy
Dest(, c + 7).PasteSpecial xlPasteValues
c = c + 7
Next i
[C30:C35].Copy
Dest(, 79).PasteSpecial Paste:=xlPasteValues, Transpose:=True
[E31:F31].Copy Dest(, 85)
[H30:H32].Copy
Dest(, 87).PasteSpecial Paste:=xlPasteValues, Transpose:=True
End With
Application.CutCopyMode = False
End Sub