A
Alan
I have a worksheet that contains two ranges that I want to use as
Query Tables. I have set up the first query and it works fine, since
then I have copied and pasted the code into a new sub and modified it
to point to the second range but I get an "Application-defined or
object-defined error" at the line:
With QTable.QueryTable
Could anyone suggest what is going wrong or put me on the right track
again?
Code is shown below ....
Sub GetFCVvalue(ByVal FCVTag As String)
Dim QTable As Range
With ThisWorkbook.Worksheets("System")
Set QTable = .Range("Flow")
End With
' Run the query
With QTable.QueryTable ' Sub fails here ...
' Query definition here
End With
End Sub
Regards,
Alan
Query Tables. I have set up the first query and it works fine, since
then I have copied and pasted the code into a new sub and modified it
to point to the second range but I get an "Application-defined or
object-defined error" at the line:
With QTable.QueryTable
Could anyone suggest what is going wrong or put me on the right track
again?
Code is shown below ....
Sub GetFCVvalue(ByVal FCVTag As String)
Dim QTable As Range
With ThisWorkbook.Worksheets("System")
Set QTable = .Range("Flow")
End With
' Run the query
With QTable.QueryTable ' Sub fails here ...
' Query definition here
End With
End Sub
Regards,
Alan