Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Export To Excel From Access 97'


Message #1 by "KennethMungwira" <KennethMungwira@Y...> on Fri, 22 Mar 2002 16:53:14
Dear Sir or Madam,

I have written a query that runs a report in my access database, but I 
would like to oppion to instead of a report, export to Excel. I would like 
to export the information which comes from tables to be exported to excel 
spread sheet outside the database so my users can sort the information 
according to thier desires.

Is this applicable.

thank you
Message #2 by "Mike" <mike.day@o...> on Fri, 22 Mar 2002 17:02:39
try


DoCmd.TransferText acExportDelim,, "Your table/Query name", "C:\file.doc"
Message #3 by "Gerald, Rand" <RGerald@u...> on Fri, 22 Mar 2002 11:06:53 -0600
Even better,

Try:

            DoCmd.TransferSpreadsheet acExport, 
acSpreadsheetTypeExcel9,
"Your query name", "output file path & name", True

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: Mike [mailto:mike.day@o...]
Sent: Friday, March 22, 2002 11:03 AM
To: Access
Subject: [access] Re: Export To Excel From Access 97'

try


DoCmd.TransferText acExportDelim,, "Your table/Query name", 
"C:\file.doc"
Message #4 by "KennethMungwira" <KennethMungwira@Y...> on Fri, 22 Mar 2002 20:03:25
Found that this code places excel spreadsheet, but how would other users 
know where to place the file. This code is behind 'Click' Command button. 
How would they change the "j:km\"



Private Sub Command109_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union 
Test", "j:km\file.xls", True
'DoCmd.TransferText acExportDelim, , "Union Test", "j:km\file.doc", True
End Sub


Message #5 by "Gerald, Rand" <RGerald@u...> on Fri, 22 Mar 2002 14:11:36 -0600
Kenneth,

If you put the command button on a form, then you could also have a 
text box
on the form to input the location of the output spreadsheet.

Private Sub Command109_Click()
Dim strTarget As String

StrTarget =3D Me.txtOutputLocation & "\file.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union 
Test",
strTarget, True
End Sub

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: KennethMungwira [mailto:KennethMungwira@Y...]
Sent: Friday, March 22, 2002 2:03 PM
To: Access
Subject: [access] Re: Export To Excel From Access 97'

Found that this code places excel spreadsheet, but how would other 
users
know where to place the file. This code is behind 'Click' Command 
button.
How would they change the "j:km\"



Private Sub Command109_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union
Test", "j:km\file.xls", True
'DoCmd.TransferText acExportDelim, , "Union Test", "j:km\file.doc", 
True
End Sub


Message #6 by "KennethMungwira" <KennethMungwira@Y...> on Fri, 22 Mar 2002 21:12:39
How would I use the dialog box, and this would limit confussion with the 
users directory. The text box is fine, but I'm on a huge network.

Thank you 




> Kenneth,

If you put the command button on a form, then you could also have a 
text box
on the form to input the location of the output spreadsheet.

Private Sub Command109_Click()
Dim strTarget As String

StrTarget =3D Me.txtOutputLocation & "\file.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union 
Test",
strTarget, True
End Sub

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: KennethMungwira [mailto:KennethMungwira@Y...]
Sent: Friday, March 22, 2002 2:03 PM
To: Access
Subject: [access] Re: Export To Excel From Access 97'

Found that this code places excel spreadsheet, but how would other 
users
know where to place the file. This code is behind 'Click' Command 
button.
How would they change the "j:km\"



Private Sub Command109_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union
Test", "j:km\file.xls", True
'DoCmd.TransferText acExportDelim, , "Union Test", "j:km\file.doc", 
True
End Sub


Message #7 by "Haslett, Andrew" <andrew.haslett@i...> on Mon, 25 Mar 2002 13:50:26 +1030
Kenneth, you'll need to do some research on 'comdlg32.dll' which is the
component used for the Open/Save dialogue box.

A simple search for 'comdlg32.dll' on google or at some of the Access
Community sites will provide the necessary code.

Cheers,

Andrew

-----Original Message-----
From: KennethMungwira [mailto:KennethMungwira@Y...]
Sent: Saturday, 23 March 2002 7:43 AM
To: Access
Subject: [access] Re: Export To Excel From Access 97'


How would I use the dialog box, and this would limit confussion with the 
users directory. The text box is fine, but I'm on a huge network.

Thank you 




> Kenneth,

If you put the command button on a form, then you could also have a 
text box
on the form to input the location of the output spreadsheet.

Private Sub Command109_Click()
Dim strTarget As String

StrTarget =3D Me.txtOutputLocation & "\file.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union 
Test",
strTarget, True
End Sub

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: KennethMungwira [mailto:KennethMungwira@Y...]
Sent: Friday, March 22, 2002 2:03 PM
To: Access
Subject: [access] Re: Export To Excel From Access 97'

Found that this code places excel spreadsheet, but how would other 
users
know where to place the file. This code is behind 'Click' Command 
button.
How would they change the "j:km\"



Private Sub Command109_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Union
Test", "j:km\file.xls", True
'DoCmd.TransferText acExportDelim, , "Union Test", "j:km\file.doc", 
True
End Sub



  Return to Index