I have a database in Access 2010 where in various different areas I use a simple piece of code to copy the content of a field to the clipboard so that it can be pasted in another program. This is fine until I come to paste it into Excel 2010, where for some reason the clipboard is cleared.
Firstly, here's my code (the field I am copying from is CopyToXL):
To test this function, I commented out the lines as shown and tried pasting into WordPad. That works fine. However, remove the comment markers and it doesn't!
The 'Reconciled' line just places a tick in a box on the main screen once, in theory, the field has been copied...
Help... please?
:banghead:
Firstly, here's my code (the field I am copying from is CopyToXL):
Code:
Private Sub spreadsheet_Click()
'On Error GoTo Exit_spreadsheet_Click
CopyToXL.SetFocus
DoCmd.RunCommand acCmdCopy
'Set openExcel = CreateObject("Excel.Application")
'openExcel.Visible = True
'
'On Error Resume Next
'
'openExcel.UserControl = True
'ExcelPath = Forms![startup]![ExcelPath]
'openExcel.Workbooks.Open ExcelPath
Me.Reconciled = True
Exit_spreadsheet_Click:
End Sub
To test this function, I commented out the lines as shown and tried pasting into WordPad. That works fine. However, remove the comment markers and it doesn't!
The 'Reconciled' line just places a tick in a box on the main screen once, in theory, the field has been copied...
Help... please?
:banghead: