opening an exported excel file after export

G

Guest

Hi,
I know how to export files from access but want to give the users the option
of going into that file via msg box after the export. Anyone know the command
to open a file. Below is what I'm using for txt files (soon to be excel)

thanks

exportTimeStamp = exDay & exMonth & exYear
exportPathName = "Z:\alm\ALM\TWS\TWSCOREFILES\Financing LLC\pipe_exports"
exportPathName = exportPathName & "\AEGIS_POSITION_" & exportTimeStamp &
".txt"

DoCmd.TransferText acExportDelim, "AssetSLN", "Asset and SLN Data",
exportPathName, False
MsgBox "The file 'Asset and SLN Data' has been exported successfully",
vbOKOnly
<____need command to open file from its location____>
 
G

Guest

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
qdf.Name, strSaveFileName, True, strRangeName
Call Shell("Excel " & Chr$(34) & strSaveFileName & Chr$(34),
vbMaximizedFocus)
 
J

John Nurick

Hi Frank,

Application.FollowHyperlink exportPathName

should open the file (txt, xls or other) using the user's default
software for that file type.
 
G

Guest

The only issue I have with using FollowHyperlink is that network
administrators tend to set the macro security on the network to at least
medium. Even if you have macro security set to low in the mdb so you don't
get the warning message, the network security will override that and you get
the message anyway.
Except for that, I like it better because it does most of the work for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top