Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / July 2003

Tip: Looking for answers? Try searching our database.

CommonDialog Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antonio - 25 Jul 2003 15:22 GMT
I have a CommonDialog control on a form to save the
database into an excel spreadsheet.  When I click on the
Download button, the SaveAs Dialog box appears, but I it
doesn't save the file.  this is my code:
Am I forgetting something?  Thanks

Private Sub cmdDownloadList_Click()
'Set the common dialog box
Dim cdl As CommonDialog

On Error GoTo ErrorDownload

Set cdl = New CommonDialog
cdl.Filter = _
   "Excel Files (*.xls)|" & "*.xls|" & _
   "Text Files (*.txt)|" & "*.txt|" & _
   "All Files (*.*)|" & "*.*|"

cdl.FilterIndex = 1
cdl.DialogTitle = "Download GEM Customers List"
cdl.ShowSave

'destroy the common dialog box
ErrorDownload_Exit:
Set cdl = Nothing
Exit Sub

ErrorDownload:
Select Case Err.Number
   Case cdlCancel
       'Cancelled
       Resume ErrorDownload_Exit
   Case Else
       MsgBox "Error: " & Err.Description & "(" &
Err.Number & ")"
End Select
MsgBox "The file has been saved to:" & vbCrLf &
cdl.FileName, vbInformation, "Download Complete"
Resume ErrorDownload_Exit
End Sub
Douglas J. Steele - 25 Jul 2003 19:45 GMT
All that code does is return the name of the file to use. You have to write
your own code to actually save the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele

> I have a CommonDialog control on a form to save the
> database into an excel spreadsheet.  When I click on the
[quoted text clipped - 36 lines]
> Resume ErrorDownload_Exit
> End Sub
Larry Daugherty - 28 Jul 2003 03:59 GMT
If you haven't got the CDL going yet I suggest you try the code supplied by
Ken Getz on http://mvps.org/access.  It includes a TestIt routine that
demonstrates how to use the code.  By using that code you should avoid OS
glitches and various versioning issues.

hth
Signature

-Larry-
--

> I have a CommonDialog control on a form to save the
> database into an excel spreadsheet.  When I click on the
[quoted text clipped - 36 lines]
> Resume ErrorDownload_Exit
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.