I am switching from Access 97 to Access XP (2002).
I have been using Excel 97 to chart the results of my query.
Upon running the query I am selecting all the records and copying them to the clipboard.
I then instruct the user to “Place the cursor in cell A1 and paste (Ctl+V)”
This pastes the results of the query into Excel and the chart is updated.
Now that I am using Access 2002 and Excel 2002 the paste is done as a graphic, not text.
How can I get the query results into Excel 2002 as text?
Private Sub Command42_Click()
‘————————————————————
‘ Opens query and pastes information into a spreadsheet for charting.
‘————————————————————
On Error GoTo PctScrapWeekly_Err
‘ Open query
DoCmd.OpenQuery “qxtbPctScrapWeeklyDexIn”, acNormal, acReadOnly
‘ Select all records
DoCmd.RunCommand acCmdSelectAllRecords
‘ Copy Records
DoCmd.RunCommand acCmdCopy
‘ Close Query
DoCmd.Close acQuery, “qxtbPctScrapWeeklyDexIn”
‘ Instructions to paste the clipboard into the Excel sheet.
Beep
MsgBox “Place the cursor in cell A1 and paste (Ctl+V)”, vbInformation, “”
‘ Open Excel file DexInWeekly.xls
Call Shell(“C:Program FilesMicrosoft OfficeOfficeExcel.exe “”O:Growtth2PctScrapWeeklyPctScrapDexIn.xls”””, 1)
PctScrapWeekly_Exit:
Exit Sub
PctScrapWeekly_Err:
MsgBox “There is not any data for this date range.”
DoCmd.Close acQuery, “qxtbPctScrapWeeklyDexIn”
Resume PctScrapWeekly_Exit
End Sub