Importing/Exporting Data

G

Guest

I am posting this again both here and in the Excel forum in the hope that
someone can solve my problem.

I have a database query written in Access97 which I export to Excel97.
When it is just saved as a spreadsheet, all the data is imported into Excel.
However, wheh I save it as FORMATTED, it chops off half of the data in some
cells.

Is there a reason for this or a setting in Excel? I cannot find any useful
information on the exporting of formatted data.

Please help!
 
G

Guest

Create a new button and insert this into the "on-click" property

Private Sub NEW_BUTTON_Click()
On Error GoTo NEW_BUTTON_Click_Err
DoCmd.TransferSpreadsheet acExport, 8, "INSERT YOUR QUERY NAME", "INSERT
THE PATH YOU WANT THE FILE TO GO TO", True, ""

NEW_BUTTON_Click_Exit:
Exit Sub

NEW_BUTTON_Click_Err:
MsgBox Error$
Resume NEW_BUTTON_Click_Exit

End Sub

An example of the file path would be C:\Documents and Settings
The "8" in the code will export your file as Excell97


Hope this helps
 
G

Guest

Thanks for replying, however I am getting an error message: it doesnt like
the C:\mydocuments bit.

Private Sub Command1_Click()
On Error GoTo Command1_Click_Err
DoCmd.TransferSpreadsheet acExport, 8, "qry(AM)Med110", "INSERT "
c:\mydocuments", True, ""

Command1_Click_Exit:
Exit Sub

Command1_Click_Err:
MsgBox Error$
Resume Command1_Click_Exit

End Sub
 

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