An 400 error msg

  • Thread starter David García Sánchez
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top