Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating a SQL stored procedure within EXCEL
I'm returning data from a SQL stored procedure that has 2 inputs Date1 and
Date2 using the following VB code. With ActiveSheet.QueryTables.Add(ConnectionString, Range("A1")) .CommandText = "EXEC sp_date_range_to_oee_values Date1, Date2 .Name = "Query from Plater_SQL" .FieldNames = True .PreserveFormatting = True .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = True .SaveData = True .AdjustColumnWidth = True .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With It works ok but when I run it a second or third time it creates another data set and concatenates it to the right of the previous extraction. I'm selecting the destination cells and deleting the contents each time before running the extraction to prevent the concantenation. It's not very elegant and I'd like to make it better. Any thoughts. Jefff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run a Stored Procedure from Excel | Excel Programming | |||
Return a stored procedure value to Excel | Excel Programming | |||
execute stored procedure from excel | Excel Worksheet Functions | |||
Getting stored procedure result to excel | Excel Programming | |||
Run a stored procedure in Excel 2K | Excel Programming |