March 29, 2017 at 12:46 pm
We have a stored procedure which we use to import the data in Excel using following vba
'With ActiveSheet.QueryTables.Add(Connection:=Array(ConString1), Destination:=Range("A1"))
.CommandType = xlCmdSql
.CommandText = IpSQLCommand
.FieldNames = True
.RowNumbers = False
.Refresh BackgroundQuery:=False
'End With
This has been working fine.
Recently we added few more fields to the output of Stored Procedure.
In the SQL studio all the fields shows up but in excel all the new fields are missing.
April 2, 2017 at 7:00 pm
My recommendation would be to use an "External Data Source" in the spreadsheet rather than trying to write your own in VBA.
Other than that, you may have to clear local cache on the box for your spreadsheet to work correctly as it is. I have no idea how to do that, though. I just overhear folks in the group of people at work that do know such things and it seems to work miracles for misbehaving spreadsheets and other applications.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy