[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to save excel sheet after making changes to an opened excel sheet or how to take object of the excel file at the run time

Posted on 2005-04-26
5
Medium Priority
?
273 Views
Last Modified: 2010-04-17
I wil have to open an excel sheet on the browser.I do this by

Response.Clear()

Response.ContentType = "application/vnd.ms-excel"
Response.WriteFile("../Files/jaya.xls")

Response.End()

but after opening the excel sheet i want to make some changes on this excel sheet then save it to the same location , unable to do this bcoz i dont have run time object of this excel sheet.
when i tried to do this by

Dim xlobj As New Microsoft.Office.Interop.Excel.Application
xlobj.ActiveWorkbook.Save()

it gives error :- object reference not set to an instance of an object



Best Regards,
SoftSolvers
dotnet@softsolvers.com
0
Comment
Question by:softsolvers
3 Comments
 

Accepted Solution

by:
CYNETAddict earned 252 total points
ID: 13870038
Hi,

Try this:
Dim xlobj As New Microsoft.Office.Interop.Excel.Application
xlobj.Workbooks.Open("../Files/jaya.xls")
xlobj.ActiveWorkbook.Save()

Regards,
0
 

Author Comment

by:softsolvers
ID: 13873069
this works fine but what we have to do is - my excel file is opened in browser and then make some changes , so to do this i have to take the object of the excel sheet at run time and then through that object i will save the file but unable to get the object at run time.
0
 
LVL 4

Assisted Solution

by:fceledon
fceledon earned 248 total points
ID: 13875151
Display Excel in a browser is one thing  (and you are doing it in the right way) but receive it back is a different story !
The only way will be for the user to post it back (uploading back to your server) after saving you sheet in a local storage. You can't do this automatically using just HTML.  
fc:)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question