Hello!

It is necessary to update the data from the Excel document (the document itself) from the Sql Server. But at the same time to do it through sql query (it has a complicated selection). At the same time, in the document itself you need to be able to set filtering parameters (dates and mn), that is, you need to link the Excel document itself with the sql query. I understand that "directly" so do not come out.

Has anyone done something like this or know other options?

  • and you can not get all the data, and then the result is filtered by means of Excel? too much volume? VBA in this case is likely to be useful to you - teran
  • You can, through Microsoft Query, but it is not quite suitable for us. Yes, I already thought about the macro, without it there was no way to go. There is such an option (working, from another team) - we pull an exe-file from Excel -> it generates a csv file for us (according to our sql query) -> then we pull Excel itself so that it is updated from csv. But this option seems to me somewhat "long." Rather, Excel itself probably pulls the macro after the exe is completed - Alex
  • In the help, at least it is written that you can make queries with parameters that are entered when you run the dialog. In any case, you will probably need macros that will update the dataset when changing the values ​​of the parameters on the sheet - teran
  • by the way, something like a solution - teran
  • Something like this will (probably) - from Excel click Refresh All -> Excel pulls CMD -> CMD starts SQL select -> Select uploads data to CSV -> Excel scoops data from CSV and reports back - Alex

0