我试图通过我编写的Excel使Visio中的一个图层可见。但是,我始终是一个无效的参数错误。
这是我的密码:
Sub visio_change_shape(index_value As Variant)
Dim AppVisio As Object
Dim VisioSystems As Object
Set AppVisio = GetObject(, "Visio.Application")
AppVisio.Pages(1).Layers.Item(index_value).CellsC(visLayerVisible).FormulaU = "1"
End Sub但是,在visio中,这一行工作如下:
Private Sub Select_layers()
Dim vsoPage As Visio.Page
Dim vsoShape As Visio.Shape
Dim vsoLayers As Visio.Layers
Dim vsoLayer As Visio.Layer
Set vsoPage = ActivePage
Set vsoLayers = vsoPage.Layers
vsoLayer.CellsC(visLayerVisible).FormulaU = "1"
Next
End Sub谢谢你的线索!
发布于 2021-04-19 14:46:23
你真正需要的是:
ActiveDocument.Pages(1).Layers.Item(index_value).CellsC(visLayerVisible).Formula = "1“
index_value应该是短整数。
https://stackoverflow.com/questions/67106971
复制相似问题