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


I'M HAVING DIFICULTIES TO GET DATA FROM ANOTHER WORKBOOK. IN SOURCEBOOK
I HAVE A SHEETS WITH LOTS OF EMPTY ROWS...I WANT TO GET JUST THE DAT
FROM IT, NOT THE EMPTY SPACES TOO


Sub GetFromCOMPER()

Dim sourcebook As Workbook
Dim correctbook As Workbook
Dim Mac As Long


SaveDriveDir = CurDir
insertPath = "C:\"
ChDrive insertPath
ChDir insertPath
FName = Application.GetOpenFilename(filefilter:="Excel File
(*.xls), *.xls", _
MultiSelect:=False)

Application.ScreenUpdating = False
Set correctbook = ThisWorkbook
Set sourcebook = Workbooks.Open(FName)

Dim TelRow As Long
TelRow = 0
For Mac = 1 To 5
sourcebook.Sheets("collect").Cells((5 + (Mac - 1)), 2).Activate
ActiveCell.Offset(0, -1).Cop
correctbook.Sheets("gegevensblad").Cells(6+ TelRow, 1)

While Not IsEmpty(ActiveCell)
ActiveCell.Range("A1:C1").Cop
correctbook.Sheets("gegevensblad").Cells(6 + TelRow, 2)
ActiveCell.Offset(0, 11).Range("A1:F1").Cop
correctbook.Sheets("gegevensblad").Cells(6 + TelRow, 17)
ActiveCell.Offset(1, 0).Activate
TelRow = TelRow + 1
Wend

TelRow = TelRow + 1 'na iedere machinecontrole een rij tussen
Next



ChDrive SaveDriveDir
ChDir SaveDriveDir

Application.ScreenUpdating = True



End Sub

When I run the macro, I get the message Automation error, the cod
stops at the red text in code above.
Any suggestions what my problem is

--
Zur
-----------------------------------------------------------------------
Zurn's Profile: http://www.excelforum.com/member.php...fo&userid=1464
View this thread: http://www.excelforum.com/showthread.php?threadid=26810

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
Automation Error xlEnt Excel Discussion (Misc queries) 2 May 15th 06 11:37 PM
Automation Error Bob Barnes Charts and Charting in Excel 3 November 7th 05 08:37 PM
Automation error Tali[_2_] Excel Programming 3 August 6th 04 12:48 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 10:19 AM.

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"