Using AutoCAD 2019, when I execute the following VBA code I intermittently get the error "There was an error opening the file C:\Users\Administrator\AppData\Local\Temp\mhx55ezi.ctb".
Dim CurLayout As ACADLayout
Set CurLayout = ThisDrawing.ActiveLayout
CurLayout.StyleSheet = "allblack.ctb"
I have narrowed it down to the line where I set the style sheet. When I open AutoCAD and immediately run the code I usually do not get the error, but if I wait a while and then try it then I get the error. I wrote a program that can read CTB files, and when I execute it I get the error:
Error: System.UnauthorizedAccessException: Access to the path 'C:\Users\Administrator\AppData\Local\Temp\mhx55ezi.ctb' is denied.
The file is 0 bytes, and I believe that it was created when I installed AutoCAD 2019. I believe that deleting the mhx55ezi.ctb file fixed the error. It is strange to get an error about mhx55ezi.ctb when I was setting the style sheet to a different (existing) colour table. Even though I was receiving the error, I did not notice any other side-effects other than the popup.
One setting that I had changed prior to receiving the error was to set the Plot Style Table Search Path to one also on the C:\. The Print Spooler File Location is set to "C:\Users\Administartor\AppData\Local\Temp\" and must be associated with this issue.