Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to delete an Excel worksheet by using ASP.NET?

Reply
Thread Tools

How to delete an Excel worksheet by using ASP.NET?

 
 
=?Utf-8?B?U2hhbyBZb25n?=
Guest
Posts: n/a
 
      05-10-2004

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmF2aWthbnRoW01WUF0=?=
Guest
Posts: n/a
 
      05-10-2004
Hi

You can use
File.Delete(@"c:\test.txt");
But ASP.NET Account should have write access to delete file.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

HTH
Ravikanth[MVP]



"Shao Yong" wrote:

>
>

 
Reply With Quote
 
 
 
 
Martin Dechev
Guest
Posts: n/a
 
      05-10-2004
Any excel worksheet is simply a file, so

[VB]
System.IO.File.Delete("C:\Book1.xls")
[C#]
System.IO.File.Delete(@"C:\Book1.xls");

will do.

The account with which the worker process is running should have modify
rights on the file. Usually, the worker process runs under the
ASPNET_MachineName account or in Windows 2003 under NETWORK SERVICE account.
Alternativelly, impersonate a user that has modify rights on the file. See:

http://support.microsoft.com/?kbid=306158

Greetings
Martin
"Shao Yong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>


 
Reply With Quote
 
=?Utf-8?B?U2hhbyBZb25n?=
Guest
Posts: n/a
 
      05-11-2004
Sorry, i mean how to delete the sheet of an Excel document, not the file itself.
 
Reply With Quote
 
Martin Dechev
Guest
Posts: n/a
 
      05-12-2004
You
"Shao Yong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry, i mean how to delete the sheet of an Excel document, not the file

itself.

 
Reply With Quote
 
Martin Dechev
Guest
Posts: n/a
 
      05-12-2004
Hi, Shao Yong,

You need to open the workbook with com automation and remove the worksheet
using the Excel object model.

Hope this helps
Martin
"Shao Yong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry, i mean how to delete the sheet of an Excel document, not the file

itself.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 make COPY of Worksheet(1) to some other Worksheet ??? Katja Perl Misc 1 01-14-2008 10:26 AM
adding an excel worksheet to a generetad excel file via perl FlorianKraft@gmx.de Perl Misc 1 04-17-2007 12:53 PM
How to delete excel worksheet in perl? dd007 Perl Misc 0 05-24-2006 02:53 PM
Unable to read particular worksheet from excel file using perl harshan Perl 0 07-20-2004 09:32 PM
Create Excel worksheet by using web service Tabo ASP .Net Web Services 1 10-16-2003 06:10 PM



Advertisments