all groups > sql server dts > december 2003 >
You're in the

sql server dts

group:

Refresh excel spreadsheet from sqlserver



Refresh excel spreadsheet from sqlserver prathi
12/19/2003 3:56:10 PM
sql server dts: Hi,

I am trying to refresh an excel spreadsheet from sqlserver.
1. I have setup the excel spreadsheet with external data source to the sqlserver.
2. I have an active x task as follows
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()

dim xlapp
dim xlbooks
dim xlsheet
dim SheetName
set xlapp = createobject("Excel.Application")
set xlbooks = getobject("\\marketing_list$\prathi.xls")
SheetName = "sheet1"
set xlsheet = xlbooks.worksheets(Sheetname)
xlbooks.RefreshAll
xlbooks.Save
xlapp.quit

Main = DTSTaskExecResult_Success
End Function

3. I get this message, "This action will cancel a pending refresh data command continue ?" (It is an excel message), when I press continue, the active x script continues. I don't want the excel message to show . What do I need to do so that the excel message does not show up!!

I would really appreciate any help with this.

Thanks Prathi
Re: Refresh excel spreadsheet from sqlserver Allan Mitchell
12/22/2003 8:06:42 AM
What about

Application.DisplayAlerts=False

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]
command continue ?" (It is an excel message), when I press continue, the
active x script continues. I don't want the excel message to show . What
do I need to do so that the excel message does not show up!!
[quoted text, click to view]

Re: Refresh excel spreadsheet from sqlserver prathi
12/26/2003 12:06:13 PM
I tried it but now I have a runtime error. Where do I put
Application.DisplayAlerts=False ? Do I have to put it after

set xlapp = createobject("Excel.Application").

Thanks Prathi

----- Allan Mitchell wrote: -----

What about

Application.DisplayAlerts=False

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]
command continue ?" (It is an excel message), when I press continue, the
active x script continues. I don't want the excel message to show . What
do I need to do so that the excel message does not show up!!
[quoted text, click to view]
Re: Refresh excel spreadsheet from sqlserver Allan Mitchell
12/26/2003 8:16:39 PM
Yes

xlapp.DisplayAlerts = False

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

Re: Refresh excel spreadsheet from sqlserver prathi
12/27/2003 1:16:11 PM
Thanks!!

Re: Refresh excel spreadsheet from sqlserver prathi
12/29/2003 11:36:13 AM
I am able to refresh the pivot tables on sheet1 from sqlserver. When I open the excel file, it is hidden. I have to go to windows, unhide and select workbook. How can I unhide the workbook from the activex script ? This is the activex script :

Function Main()

dim xlapp
dim xlbooks
dim xlsheet
dim SheetName
set xlapp = createobject("Excel.Application")
set xlbooks = getobject("\\ausdsps301\pub_trans$\marketing_liist\cra_detail.xls")
SheetName = "sheet1"
set xlsheet = xlbooks.worksheets(Sheetname)
xlbooks.RefreshAll
xlbooks.Save
xlapp.quit

Main = DTSTaskExecResult_Success
AddThis Social Bookmark Button