ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
How would you do this?
Basically, if the user using the workbook either doesn't have access to the drive/path where the CSVs are, or the CSV isn't there, it will bug 'not a valid path...file' or whatever.
I'm thinking of using a FileSystemObject.GetFolder method to a variant, and if the variant isn't empty, then proceed with establishing csv connection, otherwise quit/go to next?
Anyone got a better idea? (Preferably one that's a single line?
)
C
Code:
strsql1 = "SELECT * From " & fName
StatsForm.TextBox1.Value = StatsForm.TextBox1.Value & " querying " & fName & "..."
DoEvents
On Error GoTo oops
Err.Clear
If Not FPRSet Is Nothing Then Set FPRSet = Nothing
With cnImportConn1
.ConnectionTimeout = 2
.CursorLocation = adUseClient
.Open strConn1
.CommandTimeout = 0
Set FPRSet = .Execute(strsql1)
End With
Basically, if the user using the workbook either doesn't have access to the drive/path where the CSVs are, or the CSV isn't there, it will bug 'not a valid path...file' or whatever.
I'm thinking of using a FileSystemObject.GetFolder method to a variant, and if the variant isn't empty, then proceed with establishing csv connection, otherwise quit/go to next?
Anyone got a better idea? (Preferably one that's a single line?

C