To allow users with different Windows versions to run a query, I implemented a prompt that asks users if they are on Windows 10. If the user selects no, a message box pops up requesting a generic parameter value. Not sure why this is happening. Any ideas?
'Prompt user to choose which version of Windows they have
constringopt = MsgBox("Do you have Windows 10?", vbYesNoCancel, "IMAG Data")
If constringopt = vbYes Then
'Import data: Windows 10 version
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DRIVER={Oracle in OraClient11g_home1};UID=XXX;PWD=XXX;SERVER=XXX;DBQ=XXX", _
Destination:=Range("A2"), Sql:=QryStr)
.MaintainConnection = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.Refresh
.Delete
End With
ElseIf constringopt = vbNo Then
'Import data: != Windows 10 version
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DRIVER={Microsoft ODBC for Oracle};UID=XXX;PWD=XXX;SERVER=XXX;", _
Destination:=Range("A2"), Sql:=QryStr)
.MaintainConnection = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.Refresh
.Delete
End With
Else
GoTo Finish_Sub
End If