___
New Member
- Joined
- Nov 16, 2004
- Messages
- 14
Morning / Evening All,
I'm having a small problem while trying to update my 'products' sheet from an external .csv file in Excel 2007. I'm using the following code which works fine in Excel 2000...
The error message I'm getting is...
I'm guessing that this is because Excel 2007 has many more columns and rows than 2000 but I'm not sure of the best way to resolve the problem.
Any help much appreciated.
I'm having a small problem while trying to update my 'products' sheet from an external .csv file in Excel 2007. I'm using the following code which works fine in Excel 2000...
Code:
Sub openProductcsv()
On Error Resume Next
If ping("***.***.***.***") Then
Application.DisplayAlerts = False
If Not ThisWorkbook.ProtectStructure Then
Sheets("products").Delete
End If
Workbooks.Open Filename:="http://mydomain.co.uk/orders/data/products.csv"
ActiveSheet.Move Before:=Workbooks("myworkbook.xls").Sheets(1)
Else
MsgBox "Cannot connect to server. Please make sure you have internet access or use the 'Save Order For later Upload' button."
End If
Application.DisplayAlerts = True
End Sub
The error message I'm getting is...
Run-time error '1004'
Excel cannot insert the sheets into the destination workbook because it contains fewer rows and columns than the source workbook, you can select the data and then use Copy and Paste commands to insert it into the sheets of another workbook.
I'm guessing that this is because Excel 2007 has many more columns and rows than 2000 but I'm not sure of the best way to resolve the problem.
Any help much appreciated.