Share via

Excel Interop delete power query

Adam Newcombe 156 Reputation points
2021-08-20T08:16:48.92+00:00

Hi,

Is it possible to delete a power query via Excel interop? Or stop it refreshing?

My process is Open spreadsheet, Refresh all (get the latest data from SQL Server), Delete connections, send to internal customer.

But I do not want the power query to still be there.

Alternatively is there a different option from power query (and VAB) to call a SQL Stored proc.

Thanks

Microsoft 365 and Office | Development | Other
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


Answer accepted by question author

Adam Newcombe 156 Reputation points
2021-08-20T09:22:10.003+00:00

Hi,

Sorry. This is straight-forward. Amend a connection from table to sql to call a stored proc. My existing code will work, which deletes all connections in an excel workbook.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.