Solved

EXCEL VBA: Run-time error '-2147417848(80010108)'

Posted on 2004-03-22
5
2,794 Views
Last Modified: 2007-12-19
I get a

Run-time error '-2147417848(80010108)':
Method 'Text' of object 'Characters' Failed

It stops here at myEqn = .DataLabel.Characters.Text

...
With Workbooks(myBook).Charts(mySheet)
    .SeriesCollection(mySeries).Trendlines.Add(Type:=xlPower, Forward:=0, _
        Backward:=0, DisplayEquation:=False, DisplayRSquared:=False).Select
With .SeriesCollection(mySeries).Trendlines(1)
       .DisplayEquation = True
       .DataLabel.NumberFormat = "0.00000000"
       myEqn = .DataLabel.Characters.Text
...

help
0
Comment
Question by:yws812
5 Comments
 
LVL 4

Accepted Solution

by:
zombieooo earned 50 total points
ID: 10649430
Check out
Microsoft Knowledge Base Article - 815406
XL2000: Error Message: -2147417848 Method 'Style' of Object 'Range' Failed
http://support.microsoft.com/default.aspx?kbid=815406
0
 

Author Comment

by:yws812
ID: 10650670
is there a fix without having to update Excel? This algorithm is going to be distributed so it's not feasable to make everybody with a copy of this to download a path.
0
 
LVL 81

Expert Comment

by:byundt
ID: 10651439
Your code runs on my copies of Excel 2000 and 2003. Which versions are your users running?

Sub ChartLabeller()
Dim mySeries As Long
Dim myEqn As String
mySeries = 1
With ActiveChart
    .SeriesCollection(mySeries).Trendlines.Add(Type:=xlPower, Forward:=0, _
        Backward:=0, DisplayEquation:=False, DisplayRSquared:=False).Select
    With .SeriesCollection(mySeries).Trendlines(1)
           .DisplayEquation = True
           .DataLabel.NumberFormat = "0.00000000"
           myEqn = .DataLabel.Characters.Text
    End With
End With
MsgBox myEqn
End Sub
0
 

Author Comment

by:yws812
ID: 10652180
I don't know what my users are using.  that section of the code works most of the time but it bugs out sometimes. I am processing 3000 files with about 10000 rows in each file. I think it might be a memory allocation issue because i'm not declaring alot of variables because i am sloppy. is there a way to reset the memroy allocated to all the variables i use after every file?
0
 
LVL 44

Assisted Solution

by:bruintje
bruintje earned 50 total points
ID: 10655524
yes just set them to nothing like

Dim xlWbk as Workbook
set xlWbk = something
....code
set xlWbk = nothing

and do this for all objects [variables go out of scope and lose their values]
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
This article will show you how to use shortcut menus in the Access run-time environment.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now