D
Hello
I need to test for an open excel workbook from RSView32. I need to open it and bring it forward if it is not open; if it is open, I need to simply bring it forward. The appstart opens a new copy of the workbook every time. The appactivate command will not bring it forward, just activates the task bar and highlights the excel button, but that's all.
I am close with this VBA code; it does open the workbook if not open and brings it forward. It does not allow more than one copy to be open.
However, it will not bring the workbook forward if it is already open. It will activate the task bar and highlight the excel button, just like the appactivate command,but that's all. I tested it in MSWord also with the same results.
Sub OpenandorActivateandBringForward()
Dim ExcelFile As Object
'dim ExcelFile as excel.workbook 'early binding
Set ExcelFile = GetObject("C:\Documents and Settings\udn4973\My Documents\Projects\plantsysdemo\temps.xls")
ExcelFile.Parent.Visible = True
ExcelFile.Parent.UserControl = True
ExcelFile.Windows(1).Visible = True
ExcelFile.Activate
End Sub
Anyone have any previous luck with this?
Thanks!
Dan
I need to test for an open excel workbook from RSView32. I need to open it and bring it forward if it is not open; if it is open, I need to simply bring it forward. The appstart opens a new copy of the workbook every time. The appactivate command will not bring it forward, just activates the task bar and highlights the excel button, but that's all.
I am close with this VBA code; it does open the workbook if not open and brings it forward. It does not allow more than one copy to be open.
However, it will not bring the workbook forward if it is already open. It will activate the task bar and highlight the excel button, just like the appactivate command,but that's all. I tested it in MSWord also with the same results.
Sub OpenandorActivateandBringForward()
Dim ExcelFile As Object
'dim ExcelFile as excel.workbook 'early binding
Set ExcelFile = GetObject("C:\Documents and Settings\udn4973\My Documents\Projects\plantsysdemo\temps.xls")
ExcelFile.Parent.Visible = True
ExcelFile.Parent.UserControl = True
ExcelFile.Windows(1).Visible = True
ExcelFile.Activate
End Sub
Anyone have any previous luck with this?
Thanks!
Dan