PC Review


Reply
Thread Tools Rate Thread

Can not save excel files through stored procedure on Server 2008

 
 
Cahill Solutions
Guest
Posts: n/a
 
      18th Feb 2009
I have recently migrated a client from SBS 2003 with SQL 2005 to SBS 2008 and
SQL 2008.

They have some programs that are run via stored procedure using xp_cmdshell.
These programs each grab data from the database and put it into an excel
spreadsheet and save it to a directory on the server, unfortunately these
programs are now failing with the following exception:

System.Runtime.InteropServices.COMException was unhandled
Message="Exception from HRESULT: 0x800A03EC"
Source="Microsoft.Office.Interop.Excel"
ErrorCode=-2146827284
StackTrace:
at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object
Filename, Object FileFormat, Object Password, Object WriteResPassword, Object
ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
TextVisualLayout, Object Local)
at MailExceptions.Program.Main(String[] args)
InnerException:

If the program is run manually, that is double clicking on the icon, it runs
perfectly.

I have tried removing UAC in Server 2008, changing permissions on the
directory where the excel file is created, where the program is run, etc...

I was advised to ask in this community for help by the folks in the SBSC
managed newsgroups.

Any ideas on a setting within SQL, or the code, to allow this to run would
be much appreciated.

I don't think the problem is with SQL 2008, as I have installed SQL 2005
both 32 and 64 bit and the same problem persists with all versions.

 
Reply With Quote
 
 
 
 
MeistersingerVonNurnberg
Guest
Posts: n/a
 
      18th Feb 2009

Hi -

XL version would be helpful.

your xp_cmdshell calls are likely translating / casting whatever you are
passing in a "new" way not understood by your existing (and presumably
unchanged) XL app.

check version compatibility for the call in question between ss08 and what
xl you use.


"Cahill Solutions" wrote:

> I have recently migrated a client from SBS 2003 with SQL 2005 to SBS 2008 and
> SQL 2008.
>
> They have some programs that are run via stored procedure using xp_cmdshell.
> These programs each grab data from the database and put it into an excel
> spreadsheet and save it to a directory on the server, unfortunately these
> programs are now failing with the following exception:
>
> System.Runtime.InteropServices.COMException was unhandled
> Message="Exception from HRESULT: 0x800A03EC"
> Source="Microsoft.Office.Interop.Excel"
> ErrorCode=-2146827284
> StackTrace:
> at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object
> Filename, Object FileFormat, Object Password, Object WriteResPassword, Object
> ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
> Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
> TextVisualLayout, Object Local)
> at MailExceptions.Program.Main(String[] args)
> InnerException:
>
> If the program is run manually, that is double clicking on the icon, it runs
> perfectly.
>
> I have tried removing UAC in Server 2008, changing permissions on the
> directory where the excel file is created, where the program is run, etc...
>
> I was advised to ask in this community for help by the folks in the SBSC
> managed newsgroups.
>
> Any ideas on a setting within SQL, or the code, to allow this to run would
> be much appreciated.
>
> I don't think the problem is with SQL 2008, as I have installed SQL 2005
> both 32 and 64 bit and the same problem persists with all versions.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call a stored procedure with paramters in SQL Server Express 2008, using code José A. Giménez [Py] Microsoft Access 3 4th Apr 2009 08:08 PM
How do I save stored procedure to XML file on server? Mark B Microsoft ASP .NET 2 25th Nov 2008 12:50 PM
Best way to call a SQL Server Stored Procedure from within Excel SQLScott Microsoft Excel Programming 2 29th Oct 2008 06:00 PM
what are the memory caps for threads running as a CLR stored procedure executed by sql server 2005? is it limited by OS only or also by sql servers memory limits? e.g. lets say my clr stored procedure is executed by sql server 2005 then it creates 10 DR Microsoft Dot NET 0 25th Oct 2007 04:38 AM
Run SQL Server stored procedure in Excel macro =?Utf-8?B?UGVkZXIgTXlocmU=?= Microsoft Excel Programming 1 8th Nov 2005 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:51 AM.