Questions about symbol libraries

Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE

I have one question about symbol libraries, please read the following code(VBA):

Sub AddRemoveSymbols()

Dim objSymLibSwitchA As SymbolLibrary

Dim shpSymBreaker2 As Shape, shpSymBreaker2A As Shape

ActiveDocument.Unit = cdrMillimeter

Set objSymLibSwitchA = SymbolLibraries.Add _

("C:\libs\switches\switchesA.csl")

Set shpSymBreaker2 = ActiveLayer.CreateSymbol(15, 20, _

"breaker2", SymbolLibraries("switchesA"))

Set shpSymBreaker2A = ActiveLayer.CreateSymbol(30, 20, _

"breaker2")

SymbolLibraries("switchesA").Delete

shpSymBreaker2.Delete

shpSymBreaker2A.Delete

ActiveDocument.SymbolLibrary.PurgeUnusedSymbols

End Sub

 

When my program run in this code, Set objSymLibSwitchA = SymbolLibraries.Add _

("C:\libs\switches\switchesA.csl"),It will occur  Application error. Who can tell me the reason.