I am working on a project where I am importing sheets from other files with the same setup. I have some code written in the worksheet module, which is expected to come with the import. I am facing an error when dealing with files placed in a shared drive. The worksheet code is being replaced automatically with the following, which is causing my file to crash.
MultiUse = -1 'True
End
Any idea why this is happening and how can it be solved?
In addition, this is my worksheet module code.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim BackDoor As Boolean
BackDoor = Worksheets("Info").Cells(8, 5).Value
If BackDoor = False Then
If ActiveCell.Locked Then
Cancel = True
End If
End If
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim BackDoor As Boolean
BackDoor = Worksheets("Info").Cells(8, 5).Value
If BackDoor = False Then
Cancel = True
End If
End Sub
This is the code I am using for importing. impSHT is the sheet I am copying for the other workbook.
If numSheets = 0 Then
impSHT.Copy After:=SHT
Else
Set LastSHT = ThisWorkbook.Worksheets(SHT.Cells(RefRow + numSheets, RefCol).Text)
impSHT.Copy After:=LastSHT
End If