• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

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

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
softsolvers
Asked:
softsolvers
2 Solutions
 
CYNETAddictCommented:
Hi,

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

Regards,
0
 
softsolversAuthor Commented:
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
 
fceledonCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now