ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I run an external command from within VBA (https://www.excelbanter.com/excel-programming/387102-how-do-i-run-external-command-within-vba.html)

k. moran

How do I run an external command from within VBA
 
Hi!

How do I run an external command from within VBA?
I want to execute a sql command from within Excel and take the SQL output an
import it into an Excel sheet for further processiing?

Thanks!

Datasort

How do I run an external command from within VBA
 
This is a long topic. I suggest that you look at ADO connections.
Look for the following

ADO command execution
ADO recordset objects
Excel CopyFromRecordset method

Good Luck.

--
Stewart Rogers
DataSort Software, L.C.


"k. moran" wrote:

Hi!

How do I run an external command from within VBA?
I want to execute a sql command from within Excel and take the SQL output an
import it into an Excel sheet for further processiing?

Thanks!


Madhan

How do I run an external command from within VBA
 
Hi, please use Shell() statement to execute external commands.

"k. moran" wrote:

Hi!

How do I run an external command from within VBA?
I want to execute a sql command from within Excel and take the SQL output an
import it into an Excel sheet for further processiing?

Thanks!



All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com