By Ganesh Gund on Friday, 15 September 2017
Posted in VBA Development
Likes 0
Views 2.6K
Votes 0
Hello all,

I have use this Function For Delete Symbol with Item but it is not work plz suggest me what is wrong from my said

Public Function DeleteSymbolFromName(oSheet As Sheet, CloseAfterDrop As Boolean, oStencil As ObjectItem, sSymbolname As String, _
WithObject As Boolean, X As Double, Y As Double, Optional oDevice As ObjectItem, Optional Scalefactor As Single)


Dim oMaster As ObjectItem
Dim oMaster1 As String
Dim sMasterUniRef As String
Dim sMasterU As String
Dim moObj As ObjectItem 'Sheet as parameter must be ObjectItem
Dim atParamData() As Aucotec.AucExecuteSheetRecord

Dim oVisio As Visio.Application
Dim vsoPage As Visio.Page
drg = oStencil.Name
For Each oMaster In oStencil.Children
oStencilNM = oStencil.Name
If oMaster.Name = sSymbolname Then
sMasterU = oMaster.Attributes.ItemByID(aucAttrSymbolSyncDesignation).Value 'sMasterU = oMaster.Attributes.ItemByID(aucAttrSymbolSyncDesignation).Value
ggg = ""
Exit For
End If

Next oMaster

If sMasterU = "" Then
MsgBox "Symbol " & sSymbolname & " not found on stencil"
Exit Function
End If

sMasterUniRef = oMaster.ID & "#" & sMasterU

If Not oSheet.IsOpened Then Call oSheet.Open(aucSheetOpenAutosave + aucSheetOpenVisio)

Set moObj = oSheet 'for Utils must be ObjectItem

ReDim atParamData(1 To 4)
atParamData(1).qual = aucOpExecSheetDeleteSymbol ''aucOpExecSheetDropSymbol
atParamData(2).qual = aucArgExecSheetRef2Master
atParamData(2).Val = sMasterUniRef
atParamData(3).qual = aucArgExecSheetPosX
atParamData(3).Val = X
atParamData(4).qual = aucArgExecSheetPosY
atParamData(4).Val = Y

If WithObject Then
ReDim Preserve atParamData(1 To 5)
atParamData(5).qual = aucArgExecSheetRef2Obj
atParamData(5).Val = oDevice.ID
End If


Call Utils.ExecuteSheetOperation(moObj, atParamData)


End Function
View Full Post