Keith Tizzard
unread,Nov 30, 2021, 7:26:38 AM11/30/21You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I create an Excel spreadsheet in VBA in Access the start of which is:
' Dim excelobj As Excel.Application
Dim excelobj As Object
Set excelobj = openExcel
With excelobj
.Workbooks.Add
.Visible = True
.ActiveWorkbook.Sheets(1).Select
.ActiveSheet.Name = "Invoice schedule"
.cells(1, 1).FormulaR1C1 = "Invoice Schedule Week Ending " & Format(Me.fromDate, "dd/mm/yyyy")
.cells(1, 1).Font.Bold = True
.cells(2, 1) = "Vehicle"
.cells(2, 2) = "Date"
.cells(2, 3) = "Contract number"
.cells(2, 4) = "Client"
All this works well. However I would like the Excel window to become the foreground window. How do I do this?
DoCmd.SelectObject does not handle this.