Solved

Call SaveAs dialog, after creating a file.

Posted on 2004-09-10
6
203 Views
Last Modified: 2013-11-13
hi all

i have created an xls file in vb using the excel object.
when this file has been created, i need to be able to display the SaveAs dialog box, so the user can download it (i am accessing my vb com through asp).
does anyone know how to do this?

thanks in advance...
0
Comment
Question by:asphead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 3

Expert Comment

by:rinksno1
ID: 12033600
after creating the excel file....save the file using ...

'Note: for the below example to work you have to make sure that your current folder where your excel file to be saved must have write permission for evey one....

tempfilename="sample"

filepath=server.MapPath(".") & "\" & tempfilename & ".xls"
Set MyFileObject = CreateObject("Scripting.FileSystemObject")
if myfileobject.FileExists(filepath)=true then
      MyFileObject.DeleteFile filepath
end if


...
.   'excel file generation using Active x DLL
.
.
.
.

AppWorld.ActiveWorkbook.SaveAs [filepath]          
AppWorld.ActiveWorkbook.Close
AppWorld.Application.Quit
Set Appworld=Nothing


Response.Redirect tempfilename & ".xls"

'''this will redirect to the excel file generated if the user had excel installed then the excel file will be displayed on the browser other wise it will show download now ....


rinks
0
 

Author Comment

by:asphead
ID: 12042231
thanks rinks. the thing is, i want to be able to display the saveAs dialog box, so the user has the option to either save the file down, or to open it.
any idea if u can do this?
0
 
LVL 3

Accepted Solution

by:
rinksno1 earned 250 total points
ID: 12051541
there is way you can display the save as dialog box in ASP, the save as dialog box is a part of active control "Commondialog" and it cannot be used in ASP unless active x is enabled in the page which is a security threat....to users...

rinks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Recommendation vb6 to vb.net or others 14 210
VB6 ListBox Question 4 57
Windows 10 new laptop initial install restart 7 45
VB.NET 2008 - Windows Protected Your PC 7 56
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

696 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