?
Solved

automation error

Posted on 2004-04-03
4
Medium Priority
?
271 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
[X]
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
  • 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 250 total points
ID: 10747699
I am sorry, I have done it only this way :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

765 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