I have a piece of code for copying from access to an excel cell but i only know how to copy text. I want to copy the content of an access text box named txt1 to cell K2 - what must i change to make it work. Tried a few different syntax solutions but all fail.
Option Compare Database
Private Sub Command0_Click()
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Set appExcel = New Excel.Application
appExcel.Visible = False
Set wbook = appExcel.Workbooks.Open("C:\Users\Alan\Documents\alanstest.xls")
Set wsheet = wbook.Worksheets("SCR")
.Range("K2").Value = "Paste Me"
Set wsheet = Nothing
Set wbook = Nothing
Set appExcel = Nothing