Hello everyone, thank you for taking the time to help me out with my problem. I have a program that deletes the old forms and imports the new ones, problem is every once in a while it cant import a file because it says the file is in use. But the last person to access the file did so 30 minutes ago. How is this possible. Is it leaving the file open in system memory ? here is the code that i am using to delete and import the file
Sub DeleteModules()
On Error Resume Next
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents("FormHelp")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
Set VBComp = ThisWorkbook.VBProject.VBComponents("frmMenu")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
Sub ImportModules()
Dim FName As String
serverconnection = "C:\timesheet\"
cPath = serverconnection
Filename = "FormHelp.frm"
FName = cPath & Filename
ThisWorkbook.VBProject.VBComponents.Import FName
Filename = "frmMenu.frm"
FName = cPath & Filename
ThisWorkbook.VBProject.VBComponents.Import FName
End Sub
any help is appriated
Bookmarks