I tried your method but am having trouble getting it running successfully.
The code keeps stopping on the line:
CurrentDb.Execute strSQL, dbFailOnError
It gives the message: "Could not find installable ISAM"
Not sure why?
The code I used was:
Private Sub cmdConvertQueryToExcelWithSQL_Click()
Dim strSQL As String
strSQL = "SELECT * INTO [Excel 9.0;Database= C:\Database By
Design\Amcor\FRC\Hazard Management\GMMReportADO.xls].[Sheet1] FROM
qryGGMReport"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
Any help greatly appreciated.
John.
I have a query which contains some memo fields. I am using Office links
to
transfer the data to Excel.
There are about 500 characters in some of the memo fields. All the data
is
displayed as expected in the query, but when the data is transferred to
Excel the data in the memo field cells is cut off.
Is there a way to make sure all data from a memo field is transferred to
Excel? ( I would be happy with a limit of even 1000 characters)
Any help greatly appreciated
Hi John,
Did you try using SQL?
The following examples are from
http://support.microsoft.com/?kbid=295646
(replace "Customer" with name of your query,
and you could just enter path to xls, instead of using
"App.Path")
1) Copy to new sheet:
strSQL = "SELECT * INTO [Excel 8.0;Database=" & App.Path & _
"\book1.xls].[Sheet1] FROM Customers"
strSQL = "SELECT * INTO [Sheet1] IN '' [Excel 8.0;Database=" & App.Path &
_
"\book1.xls] FROM Customers"
strSQL = "SELECT * INTO [Sheet1] IN ' " & App.Path & _
"\book1.xls' 'Excel 8.0;' FROM Customers"
2) Append to existing sheet:
strSQL = "INSERT INTO [Sheet1$] IN '' [Excel 8.0;Database=" & App.Path & _
"\book1.xls] SELECT * FROM Customers"
strSQL = "INSERT INTO [Sheet1$] IN '" & App.Path & _
"\book1.xls' 'Excel 8.0;' SELECT * FROM Customers"
After you have defined strSQL, use an Execute stmt.
DAO:
CurrentDb.Execute strSQL, dbFailOnError
or ADO:
CurrentProject.ActiveConnection.Execute strSQL, dbFailOnError
I *think* the truncation is a result of trying to *link*
to the Excel "table."
Of course, I could be wrong.
Good luck,
Gary Walter