Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't open an excel file (have 2007, Vista) without saving first | Excel Discussion (Misc queries) | |||
Forms--Vista--2007 Excel | Excel Worksheet Functions | |||
Invisible Application/Visible Forms? | Excel Programming | |||
XP versus Vista spreadsheet | Excel Worksheet Functions | |||
Saving Forms | Excel Programming |