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
Solved

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

Posted on 2004-03-22
5
2,887 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

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 …
Outlook Free & Paid Tools
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
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 …

856 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