Solved

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

Posted on 2004-03-22
5
2,939 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
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…

685 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