Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EXCEL 2010 7 65
Compile Error 7 51
MS Project 2013 standar edition will not active key in one computer. 5 20
Where should Group Policies be windows server 2016? 4 30
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
My experience with Windows 10 over a one year period and suggestions for smooth operation
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

776 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