My Excel worksheet contains several dataranges that each use a trusted connection. It works great when the NT user is allowed access to the database. BUT, if an NT user is not allowed access to the database: as soon as querytable(1).refresh executes, a Microsoft SQL Server Login error box pops up saying 'Connection failed:, etc...'.
I tried to handle this error with 'On Error' code, but apparently it's not recognized as an error because it never gets trapped. I guess it's a SQL 7 provider error and not an Excel error. So, is there a way to trap this type of error so that I can control what happens if a user is or isn't allowed access? If so, how?
I tried to handle this error with 'On Error' code, but apparently it's not recognized as an error because it never gets trapped. I guess it's a SQL 7 provider error and not an Excel error. So, is there a way to trap this type of error so that I can control what happens if a user is or isn't allowed access? If so, how?