EBDN - Community - Question & Answers

  Thursday, 22 July 2021
  2 Replies
  776 Visits
0
Votes
Undo
Hi,
I am wondering how to change the state of layers without opening the sheet.
Below is the code I made,
what should I edit so that I can change the state of layers without opening the sheet?
(The "FORM" layer is the EB base layer.)

Public Sub PrintForm()

Dim oVisioDocument As Visio.Document
Dim oShape As Visio.Shape
Dim oLayer As Visio.Layer
Dim oLayerBefore As Visio.Layer
Dim oVisioApp As Visio.Application
Dim oSelection As Visio.Selection
Dim oSheet As Sheet
Dim a As Integer


For a = 1 To Selection.Count
Set oSheet = Selection(a)

oSheet.Open
oSheet.Activate
Set oVisioApp = Application
oVisioApp.ShowChanges = True
oVisioApp.EventsEnabled = True


Set oLayer = oVisioApp.ActivePage.Layers("FORM";)
oLayer.CellsC(visLayerPrint).FormulaU = "0"
oSheet.Store
oSheet.Close
Next a


End Sub