I tried your code, Excel would be visible, but Sheet1 would never appear.
I copied some code from Ken Snell's site (http://www.accessmvp.com/KDSnell/EXC...m#WriteRstFile) and with a little modification, it seemes to work.
I changed your variable names - maybe you can change them back to your variable names.
Code:
Private Sub Command6_Click()
Dim filepath As String
Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
filepath = "C:\Users\ew\Desktop\modtest.xlsx"
' Replace True with False if you do not want the first row of
' the worksheet to be a header row (the names of the fields
' from the recordset)
' blnHeaderRow = True
' Establish an EXCEL application object
On Error Resume Next
Set xlx = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set xlx = CreateObject("Excel.Application")
End If
Err.Clear
On Error GoTo 0
' Change True to False if you do not want the workbook to be
' visible when the code is running
xlx.Visible = True
' Replace C:\Filename.xls with the actual path and filename
' of the EXCEL file into which you will write the data
Set xlw = xlx.Workbooks.Open(filepath)
' Replace WorksheetName with the actual name of the worksheet
' in the EXCEL file
' (note that the worksheet must already be in the EXCEL file)
Set xls = xlw.Worksheets(1)
'
xls.Range("c4") = "test"
With Sheets("sheet1").Range("c4")
With .Font
.Size = 24
.Bold = True
End With
End With
'
xlw.Close ' <<-- I added this
Set xls = Nothing
Set xlw = Nothing
Set xlx = Nothing
End Sub
Good luck with your project........