Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Saving a spreadsheet from .Net Web Forms application under Vista

I have a web forms application that uses Excel to generate a spreadsheet. I
need to save that spreadsheet by calling the SaveAs routine. I have no
problems with the code running under XP. Running under Vista I cannot save
the spreadsheet. I was originally trying to save it to the App_Data
directory that is created in c:\Program Files\MyApp\. Apparently no matter
what I do Vista will not allow me to save a file anywhere under Program
Files. I've tried using the SpecialFolder options for MyDocuments and
Internetcache - those don't work under Vista either. I also tried to save to
the c:\Windows\Temp directory, again without success.

Can somebody tell me what I need to do in order to save a spreadsheet in a
manner that works under both XP and Vista?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Saving a spreadsheet from .Net Web Forms application under Vista

Does it give you an error message? If so, what is the message?

"DaveWadd" wrote:

I have a web forms application that uses Excel to generate a spreadsheet. I
need to save that spreadsheet by calling the SaveAs routine. I have no
problems with the code running under XP. Running under Vista I cannot save
the spreadsheet. I was originally trying to save it to the App_Data
directory that is created in c:\Program Files\MyApp\. Apparently no matter
what I do Vista will not allow me to save a file anywhere under Program
Files. I've tried using the SpecialFolder options for MyDocuments and
Internetcache - those don't work under Vista either. I also tried to save to
the c:\Windows\Temp directory, again without success.

Can somebody tell me what I need to do in order to save a spreadsheet in a
manner that works under both XP and Vista?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Saving a spreadsheet from .Net Web Forms application under Vis

The error I get depends on which directory I try to use. Most of the time it
tells me it can't find a portion of the path even though the path displayed
exists. When I tried to write to personal documents area it told me I did
not have rights to the root of the C drive. I have no idea why it would be
trying to write to c:\ in that case.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Saving a spreadsheet from .Net Web Forms application under Vis

Ffrom XP to vista requires different file extensions, and if you are not
using the correct ones, it will tell you that the operation failed, without
telling you why. I suppose you knew that. If it is not finding the path you
want, go to windows explorer and locate a file in a folder that you want to
save the file to. Right click the file and select properties from the drop
down menu. On the general tab there is a location caption. That is the path
to that file, so if you copy that path, then you should be able to paste that
in the SaveAs dialog box and add the file name. If it still fails, you might
need technical assistance.



"DaveWadd" wrote:

The error I get depends on which directory I try to use. Most of the time it
tells me it can't find a portion of the path even though the path displayed
exists. When I tried to write to personal documents area it told me I did
not have rights to the root of the C drive. I have no idea why it would be
trying to write to c:\ in that case.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Saving a spreadsheet from .Net Web Forms application under Vis

I don't think I've explained the problem well enough. I am doing all of this
in a C# web forms program by automating Excel using the Interop libraries.
The spreadsheet to be saved is being created and saved by that program
without user intervention. Here is the call that works in XP but not in
Vista:

theName = "FinalReport" +
String.Format("{0:yyyyMMddhhmmssttt}", DateTime.Now) + ".xls";


oSheet.SaveAs(Environment.GetFolderPath(Environmen t.SpecialFolder.InternetCache) + @"\" + theName,
Excel.XlFileFormat.xlExcel7, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);

Reply
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
Can't open an excel file (have 2007, Vista) without saving first JimC Excel Discussion (Misc queries) 12 May 30th 10 08:51 AM
Forms--Vista--2007 Excel Lost in Excel Excel Worksheet Functions 2 December 29th 09 09:58 PM
Invisible Application/Visible Forms? roy_ware Excel Programming 3 October 10th 07 02:53 AM
XP versus Vista spreadsheet S S Excel Worksheet Functions 2 August 28th 07 09:07 PM
Saving Forms kirkm[_6_] Excel Programming 2 February 23rd 07 03:32 AM


All times are GMT +1. The time now is 03:23 AM.

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

About Us

"It's about Microsoft Excel"