Hello AUGI Members:
I have a VBA routine that looks for a "plt" file in a folder and if the file exists deletes that file. A sample of the code is as follows:
This segment of code runs fine in AutoCAD 2005 on a Windows 2000 Pro system but has a problem in AutoCAD 2006 on a Windows XP Pro system. If the "plt" file already exists the routine just stops at this segment of code. If I delete the "plt" file first and then run the routine, it works fine.Code:''''''''' For i = 0 To lstSelectDwgs.ListCount - 1 If Not bTestEnv Then Application.Documents.Open CurPath & lstSelectDwgs.List(i) End If ''''''''''Get the tabl Name from CAD strCTAB = ThisDrawing.GetVariable("CTAB") iFileLen = 0 sPLTFN = "" strDwgName = CurPath & lstSelectDwgs.List(i) intDwgLen = Len(strDwgName) strActiveDwg = Left(strDwgName, intDwgLen - 4) sPLTFN = Dir(strActiveDwg & "-" & strCTAB & ".plt") If Len(sPLTFN) > 0 Then sTempFile = FileLen(sPLTFN) Else sTempFile = "" End If ''''''''''If the plt file exist delete it If sTempFile > "" Then Kill (CurPath & sPLTFN) End If
There appears to be some type of difficulty with this section of code.........can anyone please assist me and use your expertise to help identify the problem.
Any assistance would be appreciated....!
Regards,
Vince