Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Run-time error 3706. Provider cannot be found in Excel Connecting to SAS 9.4

Reply
Occasional Learner
Posts: 1

Run-time error 3706. Provider cannot be found in Excel Connecting to SAS 9.4

The code is follows and highlighted line is whats being indicated as the problem. Unclear what's causing the breakdown.

 

 

 

Public Sub GetSASData(WorksheetName As String, SASDBName As String, StartingRow As Integer)

 

   ' DECLARE VARIABLES
   Dim obConnection As New ADODB.Connection
   Dim obRecordset As New ADODB.Recordset
   Dim i As Integer
   Dim strSQL As String
  
   obConnection.Provider = "sas.LocalProvider.9.4"
   obConnection.Properties("Data Source") = Replace(ThisWorkbook.FullName, ThisWorkbook.Name, "..\") & "Raw Output\SAS Output"
  
   obConnection.Open

   'strSQL = "select * from " & SASDBName & "_" & ThisQ
   ThisWorkbook.Worksheets(WorksheetName).Activate
   ThisWorkbook.Worksheets(WorksheetName).Unprotect

   LastUpdate = FileDateTime(Replace(ThisWorkbook.FullName, ThisWorkbook.Name, "..\") & "Raw Output\SAS Output" & "\" & SASDBName & "_" & ThisQ & ".sas7bdat")
   ThisWorkbook.Worksheets(WorksheetName).Range("C" & StartingRow - 2).Value = SASDBName & "_" & ThisQ & ".sas7bdat"
   ThisWorkbook.Worksheets(WorksheetName).Range("C" & StartingRow - 1).Value = LastUpdate

Ask a Question
Discussion stats
  • 0 replies
  • 696 views
  • 0 likes
  • 1 in conversation