How to set option button values via python?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amelie Lesser
    New Member
    • Dec 2010
    • 6

    How to set option button values via python?

    Hey there,

    I'm writing a python plugin for a geo referencing program called QGIS where I want an Excel sheet to do all my calculations for me. For different data points I need to set certain input values into the spreadsheet (which was already written by someone else).
    I'm fine setting the int values (using win32com.client ) with
    Code:
    sheet.Cells(row, col).Value = value
    For radio buttons I would expect it to work like so:
    Code:
    sheet.opt_name.Value = True
    But I get the error message:
    AttributeError: '<win32com.gen_ py.Microsoft Excel 12.0 Object Library._Worksh eet instance at 0x232878608>' object has no attribute 'opt_name'
    What are the options attributes of? How do I set their values?
    Thanks a lot for any help!
  • Amelie Lesser
    New Member
    • Dec 2010
    • 6

    #2
    I finally figured it out:
    sheet.OLEObject s('optionname') .Object.Value = 1

    Comment

    Working...