Solved

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

Posted on 2004-03-22
5
2,739 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
Comment Utility
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
Comment Utility
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 80

Expert Comment

by:byundt
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

771 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

16 Experts available now in Live!

Get 1:1 Help Now