Hi, I am trying to figure out some way to open an Excel workbook from Access vba and have the focus automatically shift to Excel. What happens is is that the Excel workbook shows up as a blinking Excel icon in the taskbar. I call the following code from Access to open the Excel workbook.
Thanks in advance for any advice.
Code:
Function OpenExcel(strFileName As String) Dim XL As Excel.Application Dim WKB As New Excel.Workbook Set XL = New Excel.Application XL.Visible = True Set WKB = XL.Workbooks.Open(strFileName) WKB.Activate 'WKB.Close SaveChanges:=False Set WKB = Nothing Set XL = Nothing End Function
Comment