Bitte bitte Hilf mir, was ich fehlt, was ich getan habe.
Code: Select all
import win32com.client
appVisio = win32com.client.Dispatch("Visio.Application")
appVisio.Visible =1
doc = appVisio.Documents.Add(r'C:\Users\anas\Visio\Input\Template.vsdx')
pagObj = doc.Pages.Item(1)
stnObj = appVisio.Documents("Oneweb.vssx")
mastObj = stnObj.Masters("NDC")
shpObj1 = pagObj.Drop(mastObj, 4.25, 5.5)
shpObj1.Text = "This is some text."
# set the cell
shpObj1.CellsU("Prop.SiteName").FormulaU = "=2.5" // successfully running
shpObj2 = pagObj.Drop(mastObj, 2, 2)
shpObj2.Text = "This is some more text."
shpObj2.CellsU("Prop.SiteName").FormulaU = "Test" // getting error in this line
connectorMaster = appVisio.Application.ConnectorToolDataObject
connector = pagObj.Drop(connectorMaster, 0, 0)
connector.Cells("BeginX").GlueTo(shpObj1.Cells("PinX"))
connector.Cells("EndX").GlueTo(shpObj2.Cells("PinX"))
doc.SaveAs(r'C:\Users\anas\Visio\Output\MyDrawing.vsd')
doc.Close()
appVisio.Visible =0
appVisio.Quit()