iLogic - doesn't close opened document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I have simple procedure for reading name of title block used in template.
Dim oTemplate As DrawingDocument Dim sTitleBlockName As String 'Opens template oTemplate = ThisApplication.Documents.Open(ThisDrawing.ResourceFileName, False) 'Name of used title block sTitleBlockName = oTemplate.ActiveSheet.TitleBlock.Name 'closes tamplate oTemplate.Close(true) 'Sets actual title block ActiveSheet.TitleBlock = sTitleBlockName
But when I run this code (without any error), and try to create a new drawing, I get msg with text: "The template file is open. Please close it and try again."
What is wrong with my code?
PS: I tried to comment last line and it works. I think that sTitleBlockName is somehow connected to template file instead to read its Name value.
PPS: Moving line with file closing on the end solve my problem, but still. Is possible to use sTitleBlockName with closed template?
Inventor 2022, Windows 10 Pro
Sorry for bad English.