473,325 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Problems automating Sigmaplot via COM

Hi everybody,

I try to use python2.2 to automate Sigmaplot 8 via the COM interface.
I can fill data into a worksheet, but have problems to create a graph
:-(
When I use the CreateGraphWizard method I always get the error
message:

"com_error: (-2147352567, 'Exception occurred.', (65535, 'SigmaPlot
8.0', 'Invalid error bar source argument.', None, 0, 0), None)"

However, the type of graph I'm trying to create doesn't have error
bars!

Any idea what's going wrong?

Many thanks,

Axel Kowald

================================================== ===================
#!/usr/bin/env python
#
# Simple example how to create a Sigmaplot diagram automatically.
# 7.2003 A.Kowald
#
from win32com.client import Dispatch

app = Dispatch("SigmaPlot.Application")
app.Width = 800 # desired width & height of main window
app.Height = 600
app.Visible = True
# create notebook and automatically one section with worksheet
app.Notebooks.Add

# the NotebookItems of the "ActiveDocument" (Notebook) have now 3
items:
print app.ActiveDocument.NotebookItems.Count
# Item 0 (ItemType 7) = The notebook itself
# Item 1 (ItemType 3) = Section 1
# Item 2 (ItemType 1) = Data 1 in Section 1
# Lets name them, so we can refer to them by name.
app.ActiveDocument.NotebookItems(0).Name = "MyBook"
app.ActiveDocument.NotebookItems(1).Name = "MySection"
app.ActiveDocument.NotebookItems(2).Name = "MyData"
app.ActiveDocument.NotebookItems.Add(2) # Add graphic
page
app.ActiveDocument.NotebookItems(3).Name = "MyGraph"
dataTab = app.ActiveDocument.NotebookItems("MyData").DataTab le

# 3 methods are available for data manipulation:
# Cell(x,y,value) 0 based
# PutData(1D/2Darray, left,top)
# 1D/2Darray = GetData(left,top,right,bottom)
dataTab.Cell(0,0,17) # puts 17 in the top left corner
d = [[1,2,3],[2,4,6]] # col1 = 1,2,3 col2 = 2,4,6
dataTab.PutData(d,0,0)
rect = dataTab.GetData(0,0,2,2) # Get 3x3 tuple

# Adding column names (name,left,top,width,height=-1)
dataTab.NamedRanges.Add('X',0,0,1,-1)
dataTab.NamedRanges.Add('Y',1,0,1,-1)

# Now lets plot the data
graphPage = app.ActiveDocument.NotebookItems("MyGraph")
graphPage.CreateWizardGraph("Vertical Bar Chart","Simple Bar","XY
Pair",[0,1])

#app.Quit # stop COM server
Jul 18 '05 #1
0 1323

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Charles Banas | last post by:
weird subject - i hope more than just one curious regular will hear me out. :) ok, i've got a bit of a big problem, and i need answers as soon as possible. i know this forum is meant for web...
12
by: SunshineGirl | last post by:
I'm trying to receive events from a running instance of Internet Explorer. So far I've only been able to receive events from an instance I launch from code, but I need to receive events from all...
7
by: xzzy | last post by:
I need to automate a report in a different database (and thank yous to Terry Kreft for pointing me in the right direction). below is the code with the one line that does not work, marked: 'Does...
1
by: EnriqueM | last post by:
One question: I created an access database that has been extremely useful in my work. I dont' even know at what level of knowledge I am at. I read a lot about how to create a database, created many...
2
by: M. C | last post by:
Hello, Since I installed Office 2003, I'm experiencing problems with an automation procedure in Access (created in Access 2000) that colonizes fields in a Word merge file. I keep getting a...
2
by: Chris Potter | last post by:
I have a problem. I am constructing a database of eople's names and addresses for business purposes. This requires all of the people to be numbered eg: 1,2,3,4,5,6,7,8,9,10 But the problem lies...
4
by: Supa Hoopsa | last post by:
I am in the process of rewriting an MS Access application (access front end with SQL 2k database) in VB.NET and one of the things I would like to do is link in to the compiled Access ADE so that I...
4
by: Bit byte | last post by:
I have a project that I normally build (without problems) from the DevStudio IDE. However, I have embarked on automating all my builds (this test project being one of several). The project...
3
by: Cliff | last post by:
I'm attempting to automate input to an ASP/AJAX web-page using VBA, however, I've encountered a couple of problems: 1) when selecting from dropdown A manuallly, dropdown B is populated with a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.