Solved

automation error

Posted on 2004-04-03
4
269 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 125 total points
ID: 10747699
I am sorry, I have done it only this way :-)
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

705 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