Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I'm dealing with a closed csv file called "record".
It I open it manually, it seems a pure xls file (there is one only sheet with a series of data organized in rows and columns).
I need to copy the data to thisworkbook (which obviously is a .xlsm).
But something gets wrong.
Error 438 object doesn't support this property or method
in the following line
The process stops with the "record" file opened with the data displayed without columns (as in a notepad).
How can I figure it out?
I'm dealing with a closed csv file called "record".
It I open it manually, it seems a pure xls file (there is one only sheet with a series of data organized in rows and columns).
I need to copy the data to thisworkbook (which obviously is a .xlsm).
But something gets wrong.
Code:
Sub copy_csv
Dim wb As Workbook
Set wb = Workbooks.Open("C:\Desktop\CSV\record.csv")
ThisWorkbook.Sheets(1).Range("B1").Value = wb.Range("A1").CurrentRegion.Value
End Sub
Error 438 object doesn't support this property or method
in the following line
Code:
ThisWorkbook.Sheets(1).Range("B1").Value = wb.Range("A1").CurrentRegion.Value
The process stops with the "record" file opened with the data displayed without columns (as in a notepad).
How can I figure it out?