Discussion:
hiding xls
(too old to reply)
prathi
2003-12-30 14:46:07 UTC
Permalink
Hi,

I am refreshing all the pivot tables in an excel spreadsheet with an activex script from the server. It works fine but when I open the .xls file, the file is hidden. I have to go into windows, unhide in excel and unhide it. This is the activex script I am using

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
End Function

How do get around this ?

Thanks Prathi
Allan Mitchell
2003-12-30 15:50:10 UTC
Permalink
So the worksheet in the workbook is hidden ?

I personally open a Workbook slightly differently see here

Importing a Named Range From Microsoft Excel
(http://www.sqldts.com/default.aspx?243)
--
--
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
Post by prathi
Hi,
I am refreshing all the pivot tables in an excel spreadsheet with an
activex script from the server. It works fine but when I open the .xls
file, the file is hidden. I have to go into windows, unhide in excel and
unhide it. This is the activex script I am using
Post by prathi
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")
Post by prathi
SheetName = "sheet1"
set xlsheet = xlbooks.worksheets(Sheetname)
xlbooks.RefreshAll
xlbooks.Save
xlapp.quit
Main = DTSTaskExecResult_Success
End Function
How do get around this ?
Thanks Prathi
prathi
2003-12-30 16:21:27 UTC
Permalink
Hi Allan

I looked at the link and it is associated with importing data from excel. I am pushing data to the excel spreadsheet. On the microsoft website, it says in the article working with workbooks thru automation : "The next time the user opens Excel manually, the workbook is invisible and the user has to click Unhide on the Window menu to view the workbook

To avoid this behavior, your Automation code should unhide the workbook before editing it and saving it. Note that this does not mean Microsoft Excel itself has to be visible."

How do I do this in my activex script given below

Thanks Prath

Function Main(

dim xlap
dim xlbook
dim xlshee
dim SheetNam
set xlapp = createobject("Excel.Application"
set xlbooks = getobject("\\ausdsps301\pub_trans$\marketing_liist\cra_detail.xls"
SheetName = "sheet1
set xlsheet = xlbooks.worksheets(Sheetname
xlbooks.RefreshAl
xlbooks.Sav
xlapp.qui

Main = DTSTaskExecResult_Succes
End Functio
Allan Mitchell
2003-12-30 16:30:18 UTC
Permalink
Can you point me to the article please.
--
--
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
Hi Allan,
I looked at the link and it is associated with importing data from excel.
I am pushing data to the excel spreadsheet. On the microsoft website, it
says in the article working with workbooks thru automation : "The next time
the user opens Excel manually, the workbook is invisible and the user has to
click Unhide on the Window menu to view the workbook.
To avoid this behavior, your Automation code should unhide the workbook
before editing it and saving it. Note that this does not mean Microsoft
Excel itself has to be visible."
How do I do this in my activex script given below ?
Thanks Prathi
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
End Function
prathi
2003-12-30 17:06:14 UTC
Permalink
This is on the msdn website

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrcreatingsavingopeningclosingworkbookobjects.as

Prathi
Sachy
2004-01-05 22:00:03 UTC
Permalink
I guess you can unhide the worksheet object of a workbook
before saving it.
something like
Workbook.Sheets(1).Visible = True or False

This should work.
-----Original Message-----
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/modcore/html/deovrcreatingsavingopeningclosingworkbookob
jects.asp
Prathi
.
vinay kumar
2009-06-05 14:00:29 UTC
Permalink
Hello Prathi,
using ur code I am not able to refresh the excel below is the error i am getting.


TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at ActiveX Script Task [ActiveX Script Task]: Function not found.

Error at ActiveX Script Task: There were errors during task validation.

(Microsoft.DataTransformationServices.VsIntegration)

------------------------------
BUTTONS:

OK
------------------------------
Please help me out

From http://www.developmentnow.com/g/103_2003_12_0_0_394921/hiding-xls.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com/g/

Continue reading on narkive:
Loading...