Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > BOOK: Professional Crystal Reports for VS.NET
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2005, 12:38 AM
Registered User
Join Date: May 2005
Location: Bangalore, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Application Defined Error in Excel VBA

Sub CreateChart2()
    Dim cntr As Integer
    Dim objChart As ChartObject
    Dim myChtRange As Range
    Dim ws As Worksheet
    Dim wb As Workbook
    Set wb = Workbooks.Open("c:\mahanti\graph.xls")

    Set ws = wb.Sheets(2)

    Dim left, top, width, height
    left = 100
    top = 40
    width = 340
    height = 250

    With ws

   For cntr = 1 To 7

    Set objChart = .ChartObjects.Add( _
      left:=left, top:=top, width:=width, height:=height)
     MsgBox "add"
    With objChart.Chart

           .ChartArea.AutoScaleFont = False
        .ChartType = xlXYScatterLines

      ' Charts("Chart1").Activate

         MsgBox "activate"
      Dim i As Integer
 Dim x1 As Integer, y1 As Integer
 x1 = 2
 y1 = 4
 For i = 1 To 10

 MsgBox "infor"


    MsgBox "series"
      .SeriesCollection(i).Name = "=Sheet1!R" & x1 & "C2"
       .SeriesCollection(i).XValues = Worksheets("Sheet1").Range("a" & x1 & ":a" & x1 + 2)
        MsgBox "x series"

.SeriesCollection(i).Values = Worksheets("Sheet1").Range(Chr(66 + cntr) & x1 & ":" & Chr(66 + cntr) & x1 + 2)
' while executin the above line I am geeting 400 error

        MsgBox "y series"

        x1 = x1 + 5
  Next i

         .HasTitle = True
        .ChartTitle.Characters.Text = "My Title"
        .ChartTitle.Font.Bold = True
        .ChartTitle.Font.Size = 12
        With .Axes(xlCategory, xlPrimary)
            .HasTitle = True
            With .AxisTitle
                .Characters.Text = "users"
                .Font.Size = 10
                .Font.Bold = True
            End With
        End With
        With .Axes(xlValue, xlPrimary)
            .HasTitle = True
            With .AxisTitle
                .Characters.Text = Worksheets("sheet1").Range(Chr(66 + cntr) & "1")
                .Font.Size = 10
                .Font.Bold = True
            End With
        End With
    End With
    top = top + 300
    Next cntr
  End With

End Sub

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
error when createobject excel.application vovo Classic ASP Professional 0 February 3rd, 2005 12:29 AM
Suspected Error in "Excel 2002 VBA" book rstober Excel VBA 7 September 2nd, 2004 05:48 PM
Application-defined error Ned Pro VB 6 0 December 11th, 2003 01:55 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM

All times are GMT -4. The time now is 04:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.