Message 1 of 3
External rules will not run after saving the drawing as another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dim GoExcel As Object
Dim xlWorkbook As Object = Nothing
Dim xlWorksheet As Object = Nothing
Dim i As Integer = 1
Dim doc As Document
GoExcel = CreateObject("Excel.Application")
Dim sPathExcel As String = "C:\Users\technical\Desktop\test\test.xlsx"
Dim outputPath As String
GoExcel.Visible = False
xlWorkbook = GoExcel.Workbooks.Open(sPathExcel)
xlWorksheet = xlWorkbook.Worksheets("Sheet1")
Do
If xlWorksheet.Cells(i, 1).Value2 Is Nothing OrElse String.IsNullOrEmpty(xlWorksheet.Cells(i, 1).Value2.ToString()) Then
Exit Do
End If
componentName = xlWorksheet.Cells(i, 1).Value2.ToString()
outputPath ="C:\Users\technical\Desktop\test\" & componentName & ".idw"
ThisDoc.Document.SaveAs(outputPath, True)
iLogicVb.RunExternalRule("test")
i += 1
Loop
If xlWorkbook IsNot Nothing Then
xlWorkbook.Close(False)
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorksheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkbook)
End If
If GoExcel IsNot Nothing Then
GoExcel.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(GoExcel)
End If
I have a piece of code where the saved part works normally after I run it, but the part that runs external rules does not work. I don't know why. Can someone help me.The attachment is my test file.🤔