Jump to content

Progress Bar for Opening a file Excel


Ilounah
 Share

Recommended Posts

Do you open the workbook using AutoIt?
How long does it take to open the workbook?

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

Hi @water :) Yes im using AutoIt to open my file, using my office desktop which is xp Excel 2007 it loads faster, then yesterday on my presentation with other co-manager they let me use the laptap win10  to present the project and opening of the file take some 45sec to open :( and I'm afraid someone will open it twice if it takes to long to open and it will have a Run time error due to 2 running files.

#include <Excel.au3>

$sFileName =  @TempDir & "\Stock Requisition Template.xlsm"
FileInstall("C:\Stock Requisition Template.xlsm", $sFileName, 1)
$oExcel = _Excel_Open(False) ; Open Excel invisible
$oExcel.AutomationSecurity = 1
$oWorkbook = _Excel_BookOpen($oExcel, $sFileName)
$oExcel = _Excel_Open(True)
ObjEvent($oWorkbook, "Workbook_")
$bExit = False

While 1 ; Wait until the workbook gets closed
    Sleep(10)
    If $bExit Then
        Sleep(500) ; Make sure that Excel has closed
        FileDelete($sFileName)
        Exit
    EndIf
WEnd

Func WorkBook_BeforeClose($bCancel)
    $bExit = True
 EndFunc

 

Link to comment
Share on other sites

You could pop up a window before you open the workbook and close it when open.

#include <Excel.au3>

$sFileName =  @TempDir & "\Stock Requisition Template.xlsm"
FileInstall("C:\Stock Requisition Template.xlsm", $sFileName, 1)
$oExcel = _Excel_Open(False) ; Open Excel invisible
$oExcel.AutomationSecurity = 1
SplashTextOn("Stock Requisition", "Opening workbook: " & $sFileName) ; <== Display Text
$oWorkbook = _Excel_BookOpen($oExcel, $sFileName)
SplashOff() ; <== Remove Text 
; $oExcel = _Excel_Open(True) ; <== This statement is not needed as the Excel application is already running
$oExcel.Visible = True ; <== Make Excel visible again
ObjEvent($oWorkbook, "Workbook_")
$bExit = False

While 1 ; Wait until the workbook gets closed
    Sleep(10)
    If $bExit Then
        Sleep(500) ; Make sure that Excel has closed
        FileDelete($sFileName)
        Exit
    EndIf
WEnd

Func WorkBook_BeforeClose($bCancel)
    $bExit = True
 EndFunc

 

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

:)

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

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...