Jump to content

Excel merge issue: The selection contains multiple data values


GreenCan
 Share

Go to solution Solved by GreenCan,

Recommended Posts

Context:

I have an autoit-Excel application that basically creates a complex Gantt Chart of scheduled versus actual data (movements). 

The cells having a fixed width of 20 pixels, one column representing 15 minutes, over 24 hours the page requires about 100 columns including titles.One vertical line is one hour.

Each bock of data contains a descriptive text that is written in the first cell of the block. Blocks can span several hours.

post-42917-0-34150200-1412006384.jpg

post-42917-0-58750300-1412005631.jpg

Once completed, the whole thing is saved to Web in html format - company Intranet.

While the Excel format allows writing outside the boundaries of a cell, the text remains visible, once saved to html format, the cell content is cut off at the end of the single table cell as below example, above is merged and below not

post-42917-0-04486800-1412007849.jpg

So I solve the issue by merging the cell blocks.

This is all working alright except that at certain times (the Gantt is very complex) the application runs into a merged cell conflict resulting in an annoying but unavoidable (!?) Excel popup requiring user interaction.

post-42917-0-21339600-1412008321.jpg

The only action is to accept the conflict by pressing OK.

I know that for this reason it is not recommended to merge cells in scripted Excels (or in macros) but I don't have any other option.

Workarounds:

I solved the issue with a time-consuming workaround. Using _Excel_IsCellMerged I verify cell by cell if any of the cells to be merged are already part of a merged area. I noticed that checking for a full range of cells that contain for example one cell that is part of another merged area returns False (anyone can confirm that I am right?), which must be a bug in the function. But with very large data sheet, the systematic check takes valuable time.

; #FUNCTION# ====================================================================================================
; Function:     _Excel_IsCellMerged
; Description:      Merge/UnMerge cell(s) in a range.
; Syntax:           _Excel_IsCellMerged($oExcel, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, $CellByCell = False)
; Parameter(s):     $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew()
;                   $sRangeOrRowStart - Either an A1 range, or an integer row number to start from if using R1C1
;                   $iColStart - The starting column for the number format(left) (default=1)
;                   $iRowEnd - The ending row for the number format (bottom) (default=1)
;                   $iColEnd - The ending column for the number format (right) (default=1)
;                   $CellByCell - Verify cell by cell if any cell is part of a merged area, only possible with R1C1 ranges, default = False
; Requirement(s):   None
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0 and sets @error on errors:
;                       @error=1 - Specified object does Not exist
;                       @error=2 - Starting row or column invalid
;                           @extended=0 - Starting row invalid
;                           @extended=1 - Starting column invalid
;                       @error=3 - Ending row or column invalid
;                           @extended=0 - Ending row invalid
;                           @extended=1 - Ending column invalid
;                       @error=4 - $CellByCell onbly allowed with R1C1 range
; Author(s):        GreenCan
; Note(s):          $CellByCell can be slow; especially if checking a large range of cells
;
; #FUNCTION# ====================================================================================================
Func _Excel_IsCellMerged($oExcel, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, $CellByCell = False)
    If Not IsObj($oExcel) Then Return SetError(1, 0, 0)
    If Not StringRegExp($sRangeOrRowStart, "[A-Z,a-z]", 0) Then
        If $sRangeOrRowStart < 1 Then Return SetError(2, 0, 0)
        If $iColStart < 1 Then Return SetError(2, 1, 0)
        If $iRowEnd < $sRangeOrRowStart Then Return SetError(3, 0, 0)
        If $iColEnd < $iColStart Then Return SetError(3, 1, 0)
        If $CellByCell Then
            For $i = $sRangeOrRowStart To $iRowEnd
                For $ii = $iColStart To $iColEnd
                    If $oExcel.Activesheet.Range($oExcel.Cells($i, $ii), $oExcel.Cells($i, $ii)).MergeCells Then
                        If Not @Compiled Then ConsoleWrite ("@@ Debug(" & @ScriptLineNumber & ") : ExcelCOM3_UDF " &  _Excel_ColumnNumberToLetter($ii) & $i & " merge True" & @CR)
                        Return True
                    EndIf
                Next
            Next
            Return False
        Else
            If $oExcel.Activesheet.Range($oExcel.Cells($sRangeOrRowStart, $iColStart), $oExcel.Cells($iRowEnd, $iColEnd)).MergeCells Then
                Return True
            Else
                Return False
            EndIf
        EndIf
    Else
        If $CellByCell Then Return SetError(4, 1, 0)
        If $oExcel.Activesheet.Range($sRangeOrRowStart).MergeCells Then
            Return True
        Else
            Return False
        EndIf
    EndIf
    Return 1
EndFunc ;==>_Excel_IsCellMerged

Another method that I tried without much satisfaction is to start a parallel process waiting for the popup to appear and sending an {ENTER} key working around the issue. But this is an esthetic nightmare  ;)

Global $sWinTitle = IniReadSection($inifile,"Microsoft Excel")
Global $sWinText = IniReadSection($inifile,"The selection contains multiple data values")
Global $hWnd, $iPID
While 1
    ; watch the popup
    $hWnd = WinGetHandle($sWinTitle, $sWinText)
    If $hWnd <> "" Then
        $iPID = WinGetProcess($sWinTitle)
        ProcessSetPriority($iPID, 0)
        WinActivate($sWinTitle, $sWinText)
        Send("{ENTER}")
    EndIf
    Sleep(3000)
WEnd

I searched around MSDN and other sites but I could not find a way to get rid of the popup, by setting the response 'OK' by default.

Cry for Help:

Long explanation for a short question:

Did anyone had the same issue and solved it differently?

Thanks

GreenCan

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

_Excel_Open or _Excel_BookOpen (can't tell at the moment as I'm sitting at the airport) allows to suppress error messages by always selecting the default reply. Would this help?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

It is in _Excel_Open water :)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Another idea would be to use _Excel_Export to save the workbook as PDF and then publish it to the intranet.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I need to check if the described 'error suppression' can be activated before merging cells and deactivated when no longer needed.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I need to check if the described 'error suppression' can be activated before merging cells and deactivated when no longer needed.

Thanks water an MikahS

Fast as usual

I may have tried that, don't remember exactly anymore. I think that many messages disappear but not this one

I will check again,

On business trip or vacation?

GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

Maybe this will suprise the merge cell message you are getting..

_Excel_Open(Default, True)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

I found this in my code, so I definitely tested the feature (still the old udf with this one...)

   $oExcel = _ExcelBookNew( $Visible ) 
;~ $oExcel.DisplayAlerts = False

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

Uncomment it and test it :)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Business. One day trip. Get up 04:30, return 22:00.

I'll have a beer and go to bed. I'm done.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

This uses the new Excel UDF and doesn't display an error.

#include <Excel.au3>
$oExcel = _Excel_Open()
$oWorkBook = _Excel_BookNew($oExcel)
_Excel_RangeWrite($oWorkbook, Default, "xx", "A1")
_Excel_RangeWrite($oWorkbook, Default, "yy", "B1")
$oMerged = $oWorkbook.Activesheet.Range("A1:B1").Merge

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Uncomment it and test it :)

Yes, I did and the popup is still showing

 

This uses the new Excel UDF and doesn't display an error.

#include <Excel.au3>
$oExcel = _Excel_Open()
$oWorkBook = _Excel_BookNew($oExcel)
_Excel_RangeWrite($oWorkbook, Default, "xx", "A1")
_Excel_RangeWrite($oWorkbook, Default, "yy", "B1")
$oMerged = $oWorkbook.Activesheet.Range("A1:B1").Merge

I made the same kind of simple test yesterday evening and I could not duplicate the error, I get no display of merge conflict. The strange thing is that setting $bDisplayAlerts either True or False does not change anything, in both cases, I don't see any popup.

(Not that in the below example, the color change and the second text is not successful)

$oExcel = _Excel_Open(Default, True)
$oWorkBook = _Excel_BookNew($oExcel, 1)

$oMerged = $oWorkBook.Activesheet.Range("B3:E3").Merge
$oWorkBook.Activesheet.Range("B3").Interior.Color = 250
_Excel_RangeWrite($oWorkbook, Default, "This is the first test", "B3")


sleep(2000)
_Excel_RangeWrite($oWorkbook, Default, "This is the second TEST", "E3")
$oMerged = $oWorkBook.Activesheet.Range("E3:G3").Merge
$oWorkBook.Activesheet.Range("E3").Interior.Color = 153

$oWorkBook.Activesheet.Range("E6").Interior.Color = 153

 

And still in my Gantt script, I get the popup, I will have to dig deeper in the case I can replicate, maybe there is a circumstance where the popup overrules every setting.

Unfortunately, I am leaving for business trip within an hour and I will only be back on Friday.  I'll let you know if i can narrow the issue down to a specific case.

Issue momentarily unresolved .

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

Have a nice trip!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Solution

It took me a while to really find out what the issue was but I found it...

First of all, it is not the action of merging overlapping merged ranges that causes the popup. It is when you merge cells that have already content. Flip flop the first two lines to see the effect of DisplayAlerts = False.

;~ $oExcel = _Excel_Open(Default, False)
$oExcel = _Excel_Open(Default, True)

$oWorkBook = _Excel_BookNew($oExcel, 1)

_Excel_RangeWrite($oWorkbook, Default, ".", "A3:X3")
$oMerged = $oWorkBook.Activesheet.Range("B3:E3").Merge
$oWorkBook.Activesheet.Range("B3").Interior.Color = 250
_Excel_RangeWrite($oWorkbook, Default, "This is the second TEST", "B3")

_Excel_RangeWrite($oWorkbook, Default, "This is the second TEST", "G3")
$oMerged = $oWorkBook.Activesheet.Range("G3:I3").Merge
$oWorkBook.Activesheet.Range("G3").Interior.Color = 153

I could not replicate the issue that I had in my Gantt script, the small example did exactly what was expected. Then I started to look at the Excel functions I used and I found that v3.3.10.2 _ExcelSheetDelete sets $oExcel.Application.DisplayAlerts = True before returning :

So the result was that it cancelled the setting that was set as per below extract of my script

$oExcel =_ExcelBookNew ( $Visible )  ; excel Visible
$oExcel.DisplayAlerts = False
_ExcelSheetDelete($oExcel, 3)  ; this function sets DisplayAlerts again to True
_ExcelSheetDelete($oExcel, 2)

solved by

$oExcel =_ExcelBookNew ( $Visible )  ; excel Visible
_ExcelSheetDelete($oExcel, 3) 
_ExcelSheetDelete($oExcel, 2)
$oExcel.DisplayAlerts = False

Conclusion:

  1. Issue resolved
  2. Upgrade to the latest version of AutoIt and excel udf with water's _Excel_SheetDelete (even if it will take me a couple of months to revise all my scripts...)
  3. going to enjoy my weekend now...

 

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...