Results 1 to 5 of 5

Thread: Using MS Chart with VB Script

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Using MS Chart with VB Script

    I am trying to populate and use the MS Chart active x control with VB Script but when I pass in the array of data I get the following error: "Bad function argument"

    Here is the code that generates the error:
    Code:
    rpt.MSChart1.ChartData = mvarData
    Incidentally, I have this working in normal VB and I am trying to translate it to VBScript (which I am less fluent with). Therefore, I know my variant array contains valid data to populate the chart.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Using MS Chart with VB Script

    Is mvarData an array?

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Using MS Chart with VB Script

    Yes...but you don't declare variables in vb script, do you?

    Previously, I am populating (in a loop) it like this
    Code:
        ReDim Preserve mvarData(1, mlngJobCategoryCount)
    
        ' Add row of data to array
        mvarData(0, mlngJobCategoryCount) = mstrJobCategory & " - " & mlngJobCount
        mvarData(1, mlngJobCategoryCount) = mlngJobCount
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Using MS Chart with VB Script

    OK, that's all I could check on.

    Btw, what's rpt?

  5. #5

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Using MS Chart with VB Script

    rpt is the report object (I am scripting within an ActiveReport object).
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width