yorkshirelad
Board Regular
- Joined
- Aug 18, 2003
- Messages
- 100
This macro to import a csv file works brilliantly on my system, but when I've emailed it to a colleague to use it comes up with the following error.
Run time error '438' Object doesn't support this property or method
We are both running Excel 2007 - when I've send him the file with the content pasted, all the other macros work fine but for some reason the one below doesn't. Has anyone any ideas?
Many thanks for your help.
Sub importing_csv_cliente()
Dim file As String
Dim src As Worksheet
Dim dst As Worksheet
Application.ScreenUpdating = False
'-- determine destination range
Set dst = ActiveSheet
'-- determine source csv file
file = "cliente.csv"
'-- determine data source range
Set src = Workbooks.Open(file).Worksheets(1)
'-- copy the data
src.Range("A1:l5").Copy dst.Range("A2")
'-- close csv file
src.Parent.Close False
End Sub
Run time error '438' Object doesn't support this property or method
We are both running Excel 2007 - when I've send him the file with the content pasted, all the other macros work fine but for some reason the one below doesn't. Has anyone any ideas?
Many thanks for your help.
Sub importing_csv_cliente()
Dim file As String
Dim src As Worksheet
Dim dst As Worksheet
Application.ScreenUpdating = False
'-- determine destination range
Set dst = ActiveSheet
'-- determine source csv file
file = "cliente.csv"
'-- determine data source range
Set src = Workbooks.Open(file).Worksheets(1)
'-- copy the data
src.Range("A1:l5").Copy dst.Range("A2")
'-- close csv file
src.Parent.Close False
End Sub