Solved

automation error

Posted on 2004-04-03
4
267 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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