Is there a way to avoid that the hidden Excel window will be shown when another instance is opened / attached externally? Example: #include <Excel.au3>
#include "..\Office\Outlook\OutlookEX.au3" ;adjust this path!
Global $hGUI = GUICreate("Test")
GUISetState()
Global $aField9[2] = [9, $xlTextFormat]
Global $aFieldInfo[1] = [$aField9]
Global $oWorkbook = Null, $oExcel = _Excel_Open(False, False, True, False, True), $oOutlook = _OL_Open()
Global $sWorkbook = @ScriptDir & "\Test.txt", $sExcel = @ScriptDir & "\Test.xlsx"
$oWorkbook = _Excel_BookOpenText($oExcel, $sWorkbook, 2, $xlDelimited, Default, True, ",", $aFieldInfo, ".", Default, Default, 65001)
$iRows = $oWorkbook.ActiveSheet.UsedRange.Rows.Count - 1
$iColumns = $oWorkbook.ActiveSheet.UsedRange.Columns.Count - 1
$oOutlook_Mail = $oOutlook.CreateItem(0)
With $oOutlook_Mail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Test"
.Attachments.Add($sExcel, 1, 1)
.Display
EndWith
Do
Until GUIGetMsg() = -3
_OL_Close($oOutlook)
_Excel_Close($oExcel, False, True)
When I start the script it will load the comma separated text file hidden in the background, open a new Outlook window and attach an Excel file. Now, when I double click the attachment in the Outlook window to open the attachment also the hidden Excel window is shown. How can I avoid that the hidden window is shown? I'm using Office 2013.