Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

automation error

Posted on 2004-04-03
4
266 Views
Last Modified: 2010-05-02
I am trying to copy cells from one excel sheet to another
The part of the code  is



Application.Dialogs(xlDialogOpen).Show ("D:\Games")
filenam = ActiveWorkbook.Name
:
:
Workbooks("test.xls").Activate
Sheets("Month").Select
Range("B2").Select
If (actdate = 1) And (ActiveCell.Value <> "") Then
Call deletall
End If

Workbooks(filenam).Activate
Sheets("KR").Select
Range("B8").Select---Here the problem occurs
Total_calls = ActiveCell.Value
Workbooks("test.xls").Activate
Sheets("Month").Select
TCRow = "E" + CStr(CInt(actdate) + 1)
Range(TCRow).Select
ActiveCell.Value = Total_calls


At he point shown above I get an error Method select of range class failed followed by Error Message: -2147417848 Automation Error.

Please hlp
0
Comment
Question by:greatmanu
  • 2
  • 2
4 Comments
 

Author Comment

by:greatmanu
ID: 10747238
Method 'Select' of  object 'Range' Failed
0
 
LVL 18

Expert Comment

by:Sethi
ID: 10747301
Create a Worksheet object and use Range like this:
Set objWorkSheet = objWorkbook.Worksheets(1)
Set objRange = objWorkSheet.Range("B2:B10")
objRange.Select
0
 

Author Comment

by:greatmanu
ID: 10747336
can u suggest another simpler workaround cause,the whole thing would make my program too much to handle.Thanks for the help
0
 
LVL 18

Accepted Solution

by:
Sethi earned 125 total points
ID: 10747699
I am sorry, I have done it only this way :-)
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question