• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Possible bug with AppScript and Excel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug with AppScript and Excel?


  • Subject: Re: Possible bug with AppScript and Excel?
  • From: Christian Prinoth <email@hidden>
  • Date: Thu, 29 Jul 2010 17:27:55 +0200

Not really, but I have solved, albeit a bit kludgily, with this function:

def getaxis(chart,axis_type=k.category_axis,which_axis=k.primary_axis):
    ax=app('Microsoft Excel').get_axis(chart,axis_type=axis_type,which_axis=which_axis)
    aemcomp=ax.AS_aemreference.AEM_comparable()
    return chart.axes.ID(aemcomp[-1][0])


On Thu, Jul 29, 2010 at 15:50, Tommy Bollman <email@hidden> wrote:
Hello.

There is a recent thread at the AppleScript OsX  section of macscripter.net which may or may not help you.

On 29 Jul 2010, at 15:43, Christian Prinoth wrote:

> Hi, I am having some problems handling axes in Excel charts via python and
> appscript.
>
> I am using apple's stock python 2.6.1, appscript 0.21.1 and Excel 12.2.5 on
> Snow Leopard 10.6.4
>
> Here is how I am trying to get hold of an axis:
>
> *c=app('Microsoft
> Excel').get_axis(app.active_sheet.chart_objects[1].chart,axis_type=k.value_axis)
> *
>
>
> now c contains
>
> *app(u'/Applications/Microsoft Office 2008/Microsoft
> Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073)*
>
>
> but if I do:
>
> *c2=app('Microsoft Excel').get_axis(app.active_chart,axis_type=k.value_axis)
> *
>
>
> apparently I get the same result, in fact c==c2 returns true. Yet, if I try
> to access c, I get an error, eg
>
> *In [16]: c.maximum_scale()*
> *------------------------------------------------------------*
> *Traceback (most recent call last):*
> *  File "<ipython console>", line 1, in <module>*
> *  File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line
> 643, in __call__*
> *    return self.get(*args, **kargs)*
> *  File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line
> 499, in __call__*
> *    raise CommandError(self, (args, kargs), e, self.AS_appdata)*
> *CommandError: Command failed:*
> * *
> *OSERROR: -1728*
> * *
> *MESSAGE: The object you are trying to access does not exist*
> * *
> *COMMAND: app(u'/Applications/Microsoft Office 2008/Microsoft
> Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073).
> maximum_scale.ge*t()
>
>
> but c2 works perfectly:
>
> *In [17]: c2.maximum_scale()*
> *Out[17]: 0.080000000000000016*
>
>
> Does anyone know what I am doing wrong or if there is a bug somewhere?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden

Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
       If an idea can survive a bureaucratic review
       and be implemented it wasn't worth doing.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Possible bug with AppScript and Excel? (From: Christian Prinoth <email@hidden>)
 >Re: Possible bug with AppScript and Excel? (From: Tommy Bollman <email@hidden>)

  • Prev by Date: Re: TextWrangler scripting
  • Next by Date: Re: Public Domain Library Lister
  • Previous by thread: Re: Possible bug with AppScript and Excel?
  • Next by thread: Re:Possible bug with AppScript and Excel?
  • Index(es):
    • Date
    • Thread