Jump to content

Quick Excel question


nlgma
 Share

Recommended Posts

I need to know how to make a not visible excel file visible after the file has already been opened using $oExcel = _ExcelBookOpen($Excel,0) NOT VISIBLE ?

Syntax.........: $oExcel = _ExcelBookOpen($sFilePath, $fVisible = 1, $fReadOnly = False, $sPassword = "", $sWritePassword = "")
Parameters ....: $sFilePath - Path and filename of the file to be opened
                  $fVisible - Flag, whether to show or hide the workbook (0=not visible, 1=visible) (default=1)
                  $fReadOnly - Flag, whether to open the workbook as read-only (True or False) (default=False)
                  $sPassword - The password that was used to read-protect the workbook, if any (default is none)
                  $sWritePassword - The password that was used to write-protect the workbook, if any (default is none)
Link to comment
Share on other sites

Do you mean something like FileSetAtrrib? Look at it in the helpfile, I'm not exactly sure if that's what you're talking about.

FileSetAttrib - Sets the attributes of one or more files. I just need to make a not visible window visible. I can see the process running, just can't see the window.

Edited by nlgma
Link to comment
Share on other sites

Blow is an idea of what I'm trying to do.

#include <GuiButton.au3>
#include <GUIConstants.au3>
#include <Excel.au3>

$Test = GUICreate("Show / Hide", 305, 115, 320, 300)
$Button0 = GUICtrlCreateButton("Open", 25, 70, 130, 30)
$Button1 = GUICtrlCreateButton("Show", 155, 70, 130, 30)
$Button2 = GUICtrlCreateButton("Hide", 155, 70, 130, 30)
GUICtrlSetState($Button2 , $gui_Hide)
$Input1 = GUICtrlCreateInput("", 25, 40, 210, 20)
$Button3 = GUICtrlCreateButton("", 240, 25, 30,30, $BS_ICON)
_GUICtrlButton_SetImage($Button3, "shell32.dll", 55, True)
$Label1 = GUICtrlCreateLabel("Enter in the path to your excel file.", 25, 15, 215, 20)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button3
            $var = FileOpenDialog("Choose a file.",@ScriptDir&"", "Excel (*.csv)|ALL (*.*)")
            GUICtrlSetData($Input1,$var)
        Case $Button0
            $oExcel = _ExcelBookOpen(GUICtrlRead($Input1),0); 0 = NOT Visible | 1 = Visible
        Case $Button1
            
       ;I need it to show the Excel window.
            
            GUICtrlSetState($Button1 , $gui_Hide)
            GUICtrlSetState($Button2 , $gui_Show)
        Case $Button2
            
       ;I need it to hide the Excel window.
            
            GUICtrlSetState($Button1 , $gui_Show)
            GUICtrlSetState($Button2 , $gui_Hide)
    EndSwitch
WEnd
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...