none
Using parameters from spreadsheet to update stored procedure RRS feed

  • Question

  • Hi all. New here and new to Excel (office 365 version). We have many files with a connection to our MS SQL db to extract data using a stored procedure utilising parameters from cells in the spreadsheet. Typically the line in the VBA macro looks something like this;

    With ActiveWorkbook.Connections("SQL12 BackOrderListing").OLEDBConnection
            .CommandText = "EXECUTE dbo.uspBackOrderListing'" & Range("C4").Value & "'

    This used to work fine prior to Excel via office 365 which seems to have new get and transform functionality and I no longer seem to have an OLEDBConnection but just a MS SQL query called Query1 or Query2.

    Can anyone tell me what VBA code I now need in the new excel office 365 version to use query1 (ie execute the stored procedure with a parameter from cell C4).

    Apologies if this has come up previously. I have done a lot of searching and not found the answer.

    Thanks in advance


    • Edited by Qikslime Thursday, March 29, 2018 12:03 PM
    Thursday, March 29, 2018 8:09 AM

Answers

All replies