Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default An 400 error msg

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 Structu=True, Windows:=False

MsgBox "Log Import Complete", vbOKOnly

End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM
Error 50290: Error writing to Worksheet while using an ActiveX Control emblair3 Excel Programming 3 February 24th 04 06:03 PM


All times are GMT +1. The time now is 09:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"