santinkdr Posted March 4, 2018 Share Posted March 4, 2018 Hello friends, I am trying to create a GUI which opens a workbook in hidden mode and update the sheet with the data in the GUI. Everything works fine when no other excel workbook is open while running the program, but when any other workbook was open then the program closes the existing workbook and opens the specified workbook in the same window and although the visibility is set to HIDDEN the windows is visible. But the program updates the sheet and closes the workbook when it is done and reopens the previously open workbook again. But I want the program to not disrupt the open workbook . Please help me sort out this problem. Find the piece of code I've used to open the workbook below. Quick help would be great since I have to complete it ASAP. Func ExcelOpen() $ExcelObj = _Excel_Open() $ExcelObj.Visible = 0 If @error Then Exit MsgBox(0, "", 'Error creating object' & @CRLF & 'Error = ' & @error) Global $ExcelLxn = IniRead(@ScriptDir & '\Settings\settings.ini', 'ExcelLocation', 'location', '') $ExcelWB = _Excel_BookOpen($ExcelObj, $ExcelLxn) If @error Then Exit MsgBox(0, "", 'Error opening Workbook' & @CRLF & 'Error = ' & @error) EndFunc Thanks in advance. Link to comment Share on other sites More sharing options...
Subz Posted March 4, 2018 Share Posted March 4, 2018 Try $ExcelObj = _Excel_Open(False, False, True, True, True) Remove $ExcelObj.Visible Link to comment Share on other sites More sharing options...
santinkdr Posted March 4, 2018 Author Share Posted March 4, 2018 @Subz Thank you so much. It worked. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now