Skip to content

OLE example

Forums Forums SIMPOL Programming OLE example

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #184
    JD Kromkowski
    Participant

    There seems to be a bug in the OLE example. The error is 21. So I think that the problem is that chartobjects isn’t getting created (it remains .nul) chartobjects =@ worksheet.getobject(property=”ChartObjects”, error=e) * chartobjects.callmethod(method=”Add”, 50, 90, 270, 150, error=e) e = 0 I don’t use Excel so I don’t know enough to sort out whether the problem is in Simpol or in how you tried to implement it. When I ran a record macro in Excel to do basically what you were trying to do I got this: Range(“C1:C5”).Select ActiveSheet.Shapes.AddChart.Select ActiveChart.SetSourceData Source:=Range(“‘Sheet1’!$C$1:$C$5”) ActiveChart.ChartType = xlColumnClustered Range(“B9”).Select Although, this http://support.microsoft.com/kb/142387 suggests something closer to what you were doing. oChart = oSheet.ChartObjects.Add(50, 40, 300, 200).Chart On the other hand your example is straight from the Superbase, REM This creates a chart embedded in the current sheet REM using the Excel default format s.Range(“C1:C5”).Select() s.Selection.Copy() s.ActiveSheet.ChartObjects.Add(50,90,270,150).Select() which does work.

    #1429
    Michael
    Keymaster

    kromkowski wrote:
    > There seems to be a bug in the OLE example. The error is 21. So I
    > think that the problem is that chartobjects isn't getting created (it
    > remains .nul)
    >
    >
    > chartobjects =@ worksheet.getobject(property="ChartObjects", error=e)
    > * chartobjects.callmethod(method="Add", 50, 90, 270, 150,
    > error=e) e = 0
    >
    >
    > I don't use Excel so I don't know enough to sort out whether the
    > problem is in Simpol or in how you tried to implement it.
    >
    > When I ran a record macro in Excel to do basically what you were
    > trying to do I got this:
    >
    > Range("C1:C5").Select ActiveSheet.Shapes.AddChart.Select
    > ActiveChart.SetSourceData Source:=Range("'Sheet1'!$C$1:$C$5")
    > ActiveChart.ChartType = xlColumnClustered Range("B9").Select
    >
    >
    > Although, this http://support.microsoft.com/kb/142387 suggests
    > something closer to what you were doing.
    >
    > oChart = oSheet.ChartObjects.Add(50, 40, 300, 200).Chart
    >
    > On the other hand your example is straight from the Superbase,
    >
    > REM This creates a chart embedded in the current sheet REM using the
    > Excel default format s.Range("C1:C5").Select() s.Selection.Copy()
    > s.ActiveSheet.ChartObjects.Add(50,90,270,150).Select()
    >
    > which does work.

    Thanks for that. I just had a look, and it may for some strange reason
    depend on the version of Excel, since this example works ok here using
    Excel 2000. It may be any number of things. I don't think this is the
    last word on the OLE2 stuff, but we will need a lot more data before we
    can go further. We are just passing these calls off to wxWidgets
    currently. The example will need to be corrected though to check for
    success there then.

    Ciao, Neil

    #1740
    JD Kromkowski
    Participant

    OK. I take it that there is no documentation for this, yet.

    I tried to do OLE with WordPerfect.

    I get warning

    cannot get CLSID from ProgID

    and error 529.

    I don't know enough (since heretofore it was always easier to use DDE) to
    know whether the trouble is me, or WP or Simpol.

    #1517
    Michael
    Keymaster

    JDK wrote:
    > OK. I take it that there is no documentation for this, yet.
    >
    > I tried to do OLE with WordPerfect.
    >
    > I get warning
    >
    > cannot get CLSID from ProgID

    The warning is pretty clear. You have supplied an object name that is
    not able to be turned into a class ID. You would need to first do some
    checking on using OLE2 with Word Perfect, to make sure the methodology
    is even close to right.

    > and error 529.

    I haven't documented that one (it is new) but I would guess it is a
    general purpose OLE2 error.

    > I don't know enough (since heretofore it was always easier to use
    > DDE) to know whether the trouble is me, or WP or Simpol.

    At some stage we may have DDE client capability, but is simply not yet
    high enough on the priority list.

    Ciao, Neil

    #1741
    JD Kromkowski
    Participant

    I'm pretty sure it is correct. I can google for code as well as the next
    fellow.

    #1482
    Michael
    Keymaster

    JDK wrote:
    > I'm pretty sure it is correct. I can google for code as well as the
    > next fellow.
    >

    Try it then from Superbase, does it work? Or from Excel. The first step
    is making sure it works at all. I have had no end of support calls when
    I was at Superbase complaining that Superbase wasn't working, only to
    discover the actual problem was not a part of Superbase at all, it would
    turn out to be something totally unrelated, but because they were trying
    it from Superbase, Superbase was broken.

    Ciao, Neil

    #1745
    JD Kromkowski
    Participant

    > Try it then from Superbase, does it work? Or from Excel. The first step
    > is making sure it works at all. I have had no end of support calls when
    > I was at Superbase complaining that Superbase wasn't working, only to
    > discover the actual problem was not a part of Superbase at all, it would
    > turn out to be something totally unrelated, but because they were trying
    > it from Superbase, Superbase was broken.

    Yes, this is the problem where is it broken?

    First, am I doing something wrong. I've always use DDE rather OLE; so it
    certainly could be me.

    Second, I suppose if your OLE2Excel example worked without a hitch (as it
    does is SB3); I would have presumed that I should first look for the
    problem to be with WP. But as your OLE2Excel example didn't work
    correctly. That puts Simpol into play as a source of problem.

    Third, maybe the problem is on WP end.

    If someone could get the Excel example working completely AND give an
    example using some other application "WORD" maybe, then I would know that
    I need to search for the problem within my capacities and/or with WP.

    #1389
    Michael
    Keymaster

    JDK wrote:
    >> Try it then from Superbase, does it work? Or from Excel. The first
    >> step is making sure it works at all. I have had no end of support
    >> calls when I was at Superbase complaining that Superbase wasn't
    >> working, only to discover the actual problem was not a part of
    >> Superbase at all, it would turn out to be something totally
    >> unrelated, but because they were trying it from Superbase,
    >> Superbase was broken.
    >
    >
    > Yes, this is the problem where is it broken? First, am I doing
    > something wrong. I've always use DDE rather OLE; so it certainly
    > could be me.
    >
    > Second, I suppose if your OLE2Excel example worked without a hitch
    > (as it does is SB3); I would have presumed that I should first look
    > for the problem to be with WP. But as your OLE2Excel example didn't
    > work correctly. That puts Simpol into play as a source of problem.

    Possibly, though it may also be related to the version of Excel. When
    run on my machine, the ole2excel sample runs flawlessly. That is part of
    the problem. All this functionality does is give access to the OLE2
    layer, but everything that you do using it is dependent on the product
    that you are talking to. There are very definite limitations in the
    wxWidgets OLE2 support (only supporting out-of-process servers – exe's
    basically but not ActiveX controls).

    > Third, maybe the problem is on WP end. If someone could get the Excel
    > example working completely AND give an example using some other
    > application "WORD" maybe, then I would know that I need to search for
    > the problem within my capacities and/or with WP.

    This area tends to be full of experimentation, since it is not always
    well documented in target products.

    Until a number of people have done the experimentation, I can imagine it
    will take some time.

    Ciao, Neil

    #1742
    Jim Locker
    Member

    Neil Robinson wrote:

    > JDK wrote:
    >> OK. I take it that there is no documentation for this, yet.
    >>
    >> I tried to do OLE with WordPerfect.
    >>
    >> I get warning
    >>
    >> cannot get CLSID from ProgID

    > The warning is pretty clear. You have supplied an object name that is
    > not able to be turned into a class ID. You would need to first do some
    > checking on using OLE2 with Word Perfect, to make sure the methodology
    > is even close to right.

    >> and error 529.

    > I haven't documented that one (it is new) but I would guess it is a
    > general purpose OLE2 error.

    >> I don't know enough (since heretofore it was always easier to use
    >> DDE) to know whether the trouble is me, or WP or Simpol.

    > At some stage we may have DDE client capability, but is simply not yet
    > high enough on the priority list.

    > Ciao, Neil

    This thread is musty, but I'll dip my oar in anyway.

    I made a long and very detailed attempt to use OLE with Wordperfect from
    Superbase a long time ago and finally gave it up; the OLE interface to
    Wordperfect is broken (at least as recently as WP10) In fact, a lot of
    WP10 was broken; I still use WP8 here, for those things I still use
    Wordperfect for (mostly I use Open Office).

    Wordperfect always worked fine with DDE. If DDE isn't supported in
    simpol, I'll probably have to drop WP support.

    #1536
    Michael
    Keymaster

    Jim wrote:
    > Neil Robinson wrote:
    >
    >> JDK wrote:
    >>> OK. I take it that there is no documentation for this, yet.
    >>>
    >>> I tried to do OLE with WordPerfect.
    >>>
    >>> I get warning
    >>>
    >>> cannot get CLSID from ProgID
    >
    >> The warning is pretty clear. You have supplied an object name that
    >> is not able to be turned into a class ID. You would need to first
    >> do some checking on using OLE2 with Word Perfect, to make sure the
    >> methodology is even close to right.
    >
    >>> and error 529.
    >
    >> I haven't documented that one (it is new) but I would guess it is a
    >> general purpose OLE2 error.
    >
    >>> I don't know enough (since heretofore it was always easier to use
    >>> DDE) to know whether the trouble is me, or WP or Simpol.
    >
    >> At some stage we may have DDE client capability, but is simply not
    >> yet high enough on the priority list.
    >
    >> Ciao, Neil
    >
    > This thread is musty, but I'll dip my oar in anyway.
    >
    > I made a long and very detailed attempt to use OLE with Wordperfect
    > from Superbase a long time ago and finally gave it up; the OLE
    > interface to Wordperfect is broken (at least as recently as WP10) In
    > fact, a lot of WP10 was broken; I still use WP8 here, for those
    > things I still use Wordperfect for (mostly I use Open Office).
    >
    > Wordperfect always worked fine with DDE. If DDE isn't supported in
    > simpol, I'll probably have to drop WP support.
    >

    Worst case, somebody could probably add basic DDE client support by
    making API calls.

    Ciao, Neil

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.