mercredi 15 janvier 2020

Call to a method or determine if method is working/exists?

Is there a way that vba can determine if a method is present/available?I have two different methods that will essentially be doing the same thing, but in different ways: one being an SQL server and the other being an excel file. I want to be able to first call the SQL method, and if whatever reason that SQL method is unavailable, it will then call the excel method. But what would be the line of code in the if statement?

I know that you "Call" to methods, but what essentially is the line of code that would be:

If SQL Method is available then 
   call SQL Method
Else
   call Excel Method
End If  

Any help would be appreciated!

Aucun commentaire:

Enregistrer un commentaire