Dougmeister
New Member
- Joined
- Sep 23, 2010
- Messages
- 42
I've tried numerous code snippets over the years and none have worked 100%. I'm finally going to stick with this until I get it right this time.
1) It is being called from Outlook 2013
2) It needs to open up a specific workbook in Excel 2013
Once it gets that far, I'm good. I will do some stuff, save it, then close the workbook and exit Excel.
It would be bonus points to test to see if Excel has already been opened, if other workbooks are currently open, etc.
Current "solution" is as follows:
The problem is that it does not bring the window to the front. I've tried various API declarations in the past, including:
Help? Thanks.
1) It is being called from Outlook 2013
2) It needs to open up a specific workbook in Excel 2013
Once it gets that far, I'm good. I will do some stuff, save it, then close the workbook and exit Excel.
It would be bonus points to test to see if Excel has already been opened, if other workbooks are currently open, etc.
Current "solution" is as follows:
Code:
Set excApp = CreateObject("Excel.Application") Set excBook = excApp.Workbooks.Open(strPath & strFileName)
Set excSheet = excBook.ActiveSheet
excApp.Visible = True
The problem is that it does not bring the window to the front. I've tried various API declarations in the past, including:
Code:
'Private Declare Function BringWindowToTop Lib "user32" (ByVal HWnd As Long) As Long
'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'Private Declare Function SetFocus Lib "user32" (ByVal HWnd As Long) As Long
Help? Thanks.
Last edited: