LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I modify a SQL connection string in an xlt file from a VB6 app?

I have a VB6 app that queries and displays data from a
SQL Server database. I want to be able to open that data
in an Excel spreadsheet, for different users using
different connection strings (logins). I have been
creating dqy files on the fly and opening them with
Excel, but that precludes me from using any formatting or
using Pivot tables/charts. I would like to be able to
create an xlt template file with the formating I want,
but haven't been able to figure out how to modify the
data connection. This is what I've got so far:

Dim xlsApp As Excel.Application

If xlsApp Is Nothing Then
' Set xlsApp = New Excel.Application
Set xlsApp = CreateObject("Excel.Application")
End If
xlsApp.Workbooks.Open App.Path & "\DataReport.xlt"

' update SQL connection login
???

xlsApp.Visible = True

Any ideas?

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a connection string? BrandenK Excel Discussion (Misc queries) 0 September 25th 07 07:10 PM
PivotTable and connection string lc Excel Programming 0 November 5th 03 01:32 AM
Can't get connection string right Frank Isaacs Excel Programming 1 October 2nd 03 05:02 AM
Can't get connection string right Brad Wood[_2_] Excel Programming 0 September 30th 03 09:38 PM
What is the connection string ? Jan Karel Pieterse Excel Programming 0 July 25th 03 11:37 AM


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"