Solved

How to get an excel file to OPEN without saving it somewhere

Posted on 2015-02-24
2
104 Views
Last Modified: 2015-03-05
I have this code and I want the Excel file to just open and not output it to somewhere.  How do I change my code to do that?


Private Sub cmdExport_ALLORGS_Click()
'On Error GoTo Err_cmdExport_ALLORGS_Click

 Dim username As String, stDocName As String, stFilename As String
 
    If MsgBox("Click YES to export all Allotments to Excel, NO to export current Allotment.", vbYesNo, "Export Options") = vbYes Then
        'stDocName = "QryRecapTest_ExcelOutputALL"
    Else
        stDocName = "Copy of Allot_Q"
    End If
    

    
        
        DoCmd.OutputTo acOutputQuery, "Copy Of Allot_Q", "Excel97-Excel2003Workbook(*.xls)", "", True, "", , acExportQualityScreen
   
'Exit_cmdExport_ALLORGS_Click:
 '   Exit Sub

'Err_cmdExport_ALLORGS_Click:
 '   MsgBox Err.Description
  '  Resume Exit_cmdExport_ALLORGS_Click
    

End Sub

Open in new window

0
Comment
Question by:Jass Saini
2 Comments
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40629006
I'm not going to write the code but you would need to use automation to Open Excel, create a new workbook, make it visible, and populate the rows.

Then the user would need to save it if he wanted to.

But the question is why?  What is wrong with simply using one line of code - TransferSpreadsheet to create the file?
0
 

Author Comment

by:Jass Saini
ID: 40629022
i could use the TransferSpreadSheet ...thank You
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

789 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