Locopete99
Registered User.
- Local time
- Today, 14:13
- Joined
- Jul 11, 2016
- Messages
- 163
Hi Guys,
I'm having a compile error message come up for the below code.
The code is good, and has worked for many months, but I've come to build a mark 2 of my database to slim it down after months of changes and improvements.
The code has now stopped working
The strange thing is, its the Private Sub Label33_Click() that is being highlighted as the error??
I'm having a compile error message come up for the below code.
The code is good, and has worked for many months, but I've come to build a mark 2 of my database to slim it down after months of changes and improvements.
The code has now stopped working
Code:
Private Sub Label33_Click()
Dim Location As String
Dim DirName As String
Dim Response As String
DirName = "B:\" & fOSUserName & "\EMC Export\"
StrPath = DirName & "NPPR EMC BLANK.xls"
If Dir(DirName, vbDirectory) = "" Then
MkDir DirName
Else
End If
Dim FSO
Dim sFile As String
Dim sSFolder As String
Dim sDFolder As String
sFile = "NPPR EMC BLANK.xls"
sSFolder = "P:\CCT Hub\NPPR - CCT\"
sDFolder = StrPath
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FileExists(sSFolder & sFile) Then
MsgBox "Specified File Not Found", vbInformation, "Not Found"
ElseIf Not FSO.FileExists(sDFolder & sFile) Then
FSO.CopyFile (sSFolder & sFile), sDFolder, True
End If
DoCmd.TransferSpreadsheet acExport, 9, "Qry Template Export", StrPath, True, "export"
End Sub
The strange thing is, its the Private Sub Label33_Click() that is being highlighted as the error??