D
David García Sánchez
Hi there, Im program a "simply" copy-paste from one
worbook to another workbook cells, but it send me a
strange error message just "400", I don't know whats
happen, could someone can tell me whats wrong with my
code?... here's:
Sub Actualiza2()
ActiveWorkbook.Unprotect
Dim myCurrentWorkbook As Workbook
Dim myDataSourceWorkbook As Workbook
Dim myCurrentWorksheet As Worksheet
Set myCurrentWorkbook = ActiveWorkbook
FileToOpen = Application.GetOpenFilename("Excel Files
(*.xls), *.xls")
Set myDataSourceWorkbook = Workbooks.Open(FileToOpen)
myDataSourceWorkbook.Sheets(1).Range("C2:F2").Copy
myCurrentWorkbook.Sheets("H-M").Cells(ActiveCell.End
(xlDown).Offset(1, 0).Row, 4).Paste
Application.DisplayAlerts = False
myDataSourceWorkbook.Close
Application.DisplayAlerts = True
ActiveWorkbook.Protect Structure:=True, Windows:=False
MsgBox "Log Import Complete", vbOKOnly
End Sub
worbook to another workbook cells, but it send me a
strange error message just "400", I don't know whats
happen, could someone can tell me whats wrong with my
code?... here's:
Sub Actualiza2()
ActiveWorkbook.Unprotect
Dim myCurrentWorkbook As Workbook
Dim myDataSourceWorkbook As Workbook
Dim myCurrentWorksheet As Worksheet
Set myCurrentWorkbook = ActiveWorkbook
FileToOpen = Application.GetOpenFilename("Excel Files
(*.xls), *.xls")
Set myDataSourceWorkbook = Workbooks.Open(FileToOpen)
myDataSourceWorkbook.Sheets(1).Range("C2:F2").Copy
myCurrentWorkbook.Sheets("H-M").Cells(ActiveCell.End
(xlDown).Offset(1, 0).Row, 4).Paste
Application.DisplayAlerts = False
myDataSourceWorkbook.Close
Application.DisplayAlerts = True
ActiveWorkbook.Protect Structure:=True, Windows:=False
MsgBox "Log Import Complete", vbOKOnly
End Sub