I am trying to call the following function from the immediate window by typing"
SaveAllAsText(J:\Shared\Orders)
Anyone have any idea why this might give me
"Compile Error, Expected, List Seperator or ) "
The Code was taken from this post
Public Function SaveAllAsText(sPath)
Dim vObject, i, dbs
Set dbs = CurrentDb
For Each vObject In dbs.Containers("Forms").Documents
SaveAsText acForm, vObject.Name, sPath & "\" & vObject.Name & ".xcf"
Next
For Each vObject In dbs.Containers("Reports").Documents
SaveAsText acReport, vObject.Name, sPath & "\" & vObject.Name & ".xcr"
Next
For Each vObject In dbs.Containers("Modules").Documents
SaveAsText acModule, vObject.Name, sPath & "\" & vObject.Name & ".xcm"
Next
For Each vObject In dbs.Containers("Scripts").Documents
SaveAsText acMacro, vObject.Name, sPath & "\" & vObject.Name & ".xcs"
Next
For i = 0 To dbs.QueryDefs.Count - 1
If Left(dbs.QueryDefs(i).Name, 4) <> "~sq_" Then
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, sPath & "\" & dbs.QueryDefs(i).Name & ".xcq"
End If
Next i
Debug.Print "All done"
End Function
SaveAllAsText(J:\Shared\Orders)
Anyone have any idea why this might give me
"Compile Error, Expected, List Seperator or ) "
The Code was taken from this post
Public Function SaveAllAsText(sPath)
Dim vObject, i, dbs
Set dbs = CurrentDb
For Each vObject In dbs.Containers("Forms").Documents
SaveAsText acForm, vObject.Name, sPath & "\" & vObject.Name & ".xcf"
Next
For Each vObject In dbs.Containers("Reports").Documents
SaveAsText acReport, vObject.Name, sPath & "\" & vObject.Name & ".xcr"
Next
For Each vObject In dbs.Containers("Modules").Documents
SaveAsText acModule, vObject.Name, sPath & "\" & vObject.Name & ".xcm"
Next
For Each vObject In dbs.Containers("Scripts").Documents
SaveAsText acMacro, vObject.Name, sPath & "\" & vObject.Name & ".xcs"
Next
For i = 0 To dbs.QueryDefs.Count - 1
If Left(dbs.QueryDefs(i).Name, 4) <> "~sq_" Then
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, sPath & "\" & dbs.QueryDefs(i).Name & ".xcq"
End If
Next i
Debug.Print "All done"
End Function