By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

Saving Excel to web site

P: n/a
Hi,

Given below is my task.

An user can open the xls file from my website (loaded on the top frame).
After filling the Excel, he can click a send button at the bottom frame. By
clicking the button i have to save the file in a shared directory on the web
server by a unique name.

Is it possible ?

Any tips of how to do this ?


Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
SPA
You cannot directly save the opened excel file onto the server from the
client machine (as far as I know). But you could have it saved on the client
system and then uploaded to the server using a file upload code.

Clicking the Send button should then handle the following:

1) Save and close the excel file to the client machine (to some pre-defined
folder .. or could prompt the user to save it using Save Dialog box
2) Then upload the file to the pre-defined server directory. You could
append the timestamp with the filename to make it unique.

Hope this helps. Feel free to ask if you need more clarification on the same
:)

SPA

"Vikram" <gw*******@hotmail.com> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...
Hi,

Given below is my task.

An user can open the xls file from my website (loaded on the top frame).
After filling the Excel, he can click a send button at the bottom frame. By clicking the button i have to save the file in a shared directory on the web server by a unique name.

Is it possible ?

Any tips of how to do this ?


Jul 19 '05 #2

P: n/a
SPA
Hi

You can find VB code to invoke the File Open / Save dialog boxes. They need to be tweaked to VBScript for it to work in ASP.

If you can get the reference to the Excel workbook object in the lower frame, then you can save it using the syntax:

Activeworkbook.SaveAs filename:=Application.GetSaveAsFilename
(This is the VB Code)

In VB Script, you need to define the Excel Application and Workbook objects using CreteObject and then call the corresponding methods.

Dim oExcelApp ' excel.Application
Dim oWs ' excel.Worksheet
Dim oWb ' excel.Workbook
Dim strFileName ' String

Set oExcelApp = CreateObject("EXCEL.APPLICATION")
Set oWs = oExcelApp.ActiveSheet
Set oWb = oExcelApp.ActiveWorkbook

strFileName = <Filename used when opening the Excel file>
oWb.SaveAs strFilename

(You must set a reference to Excel in the Project | References dialog)

Refer to the following link for an idea on how to use the Excel Application object.
http://msdn.microsoft.com/library/de...celobjects.asp

You could use the same filename you used to open the excel sheet while saving to the local system too. Once the file is saved, redirect the control to FileUpload page and pass the name of the file (and path if needed) for it to upload the same.

In VB its possible to invoke the SaveAs dialog but I am not sure if we can do that in VBScript by replacing:
strFileName = <Filename used when opening the Excel file>
with
strFileName = Application.GetSaveAsFilename (You could give it a try)

Hope this helps
SPA
"Vikram" <gw*******@hotmail.com> wrote in message news:OH**************@TK2MSFTNGP12.phx.gbl...
Hi,
Thanks for the same. That was clear.

Can u point out how to save the modified excel by clicking a button save
(placed on the lower frame) in IE. When u say "save it using Save Dialog
box", it is possible to invoke that dialog box programatically ??

Thanks again for your help.

Vikram



"SPA" <sh***********@usswi.com> a écrit dans le message de
news:Ow*************@TK2MSFTNGP12.phx.gbl...
You cannot directly save the opened excel file onto the server from the
client machine (as far as I know). But you could have it saved on the

client
system and then uploaded to the server using a file upload code.

Clicking the Send button should then handle the following:

1) Save and close the excel file to the client machine (to some

pre-defined
folder .. or could prompt the user to save it using Save Dialog box
2) Then upload the file to the pre-defined server directory. You could
append the timestamp with the filename to make it unique.

Hope this helps. Feel free to ask if you need more clarification on the

same
:)

SPA

"Vikram" <gw*******@hotmail.com> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...
Hi,

Given below is my task.

An user can open the xls file from my website (loaded on the top frame).
After filling the Excel, he can click a send button at the bottom frame.

By
clicking the button i have to save the file in a shared directory on the

web
server by a unique name.

Is it possible ?

Any tips of how to do this ?






Jul 19 '05 #3

P: n/a
SPA
You could also use the following link for reference:

http://www.serverwatch.com/tutorials...le.php/1493331

http://www.microsoft.com/OfficeDev/A...PG/004/004.htm

http://www.intranetjournal.com/artic...02_25_00b.html
"Vikram" <gw*******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Hi,
Thanks for the same. That was clear.

Can u point out how to save the modified excel by clicking a button save
(placed on the lower frame) in IE. When u say "save it using Save Dialog
box", it is possible to invoke that dialog box programatically ??

Thanks again for your help.

Vikram

"SPA" <sh***********@usswi.com> a écrit dans le message de
news:Ow*************@TK2MSFTNGP12.phx.gbl...
You cannot directly save the opened excel file onto the server from the
client machine (as far as I know). But you could have it saved on the

client
system and then uploaded to the server using a file upload code.

Clicking the Send button should then handle the following:

1) Save and close the excel file to the client machine (to some

pre-defined
folder .. or could prompt the user to save it using Save Dialog box
2) Then upload the file to the pre-defined server directory. You could
append the timestamp with the filename to make it unique.

Hope this helps. Feel free to ask if you need more clarification on the

same
:)

SPA

"Vikram" <gw*******@hotmail.com> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...
Hi,

Given below is my task.

An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom
frame. By
clicking the button i have to save the file in a shared directory on
the web
server by a unique name.

Is it possible ?

Any tips of how to do this ?




Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.