By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


GetDataSource - udf - db


Function GetDatasource()
'Looks up the datasource
Dim x
Dim s As String
sDatasource = Application.Evaluate("=vlookup(""" & Thisworkbook.Sheets("Settings").Range("datasource_type") & """,[" & ThisWorkbook.Name & "]Settings!A:B,2,False)")
GetPsw
sDatasource = Replace(sDatasource,"@psw", gPsw)
sDatasource = Replace(sDatasource,"@user",gUserId)
GetDatasource = sDatasource



gPsw and gUserid are 2 global variables.

The GetPsw is a function to return the password.