?
Solved

Call SaveAs dialog, after creating a file.

Posted on 2004-09-10
6
Medium Priority
?
212 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

719 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