Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel and more than 1 workbook
#3
Excel has 1 main window and a hidden window for each workbook. When act is used to activate a currently inactive workbook, it finds the hidden window, tries to activate it, and ultimately gives error because Excel does not allow to activate the hidden window. Excel instead activates the main window and displays the workbook in it.

To activate Excel workbooks, use code like this:
Macro
Code:
Copy      Help
act win("Excel" "XLMAIN") ;;activate the main window. Use this because act does it better than SetForegroundWindow.
SetForegroundWindow win("workbook name.xls") ;;try to activate the hidden window. Unlike act, this code does not give error.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)