bartekd 0 Posted December 14, 2010 (edited) Hello All, I have a gui with tabs in it. I am trying to have one of the tabs have a excel spreadsheet in it. But what I am trying to figure out is how to remove the embeded object (so that I can add a new one to replace it). I tried both of these, but they both don't remove it. $oExcelDoc.Close (0) ; Close the excel workbook - Save prompt will not open OR _ExcelBookClose($oExcelDoc) Here is my part of script.... $Spreadsheets = GUICtrlCreateTabItem("Spreadsheets"); end tabitem definition $FileName = 'C:\test1.xls' if not FileExists($FileName) then Msgbox (0,"Excel File Test","Can't run this test, because it requires an excel file in "& $FileName) ;~ Exit endif $oExcelDoc = ObjGet($FileName) ; Get an excel Object from an existing filename if IsObj($oExcelDoc) then ;~ GUICreate ( "Embedded ActiveX Test", 640, 580, (@DesktopWidth-640)/2, (@DesktopHeight-580)/2 ) $GUI_ActiveX = GUICtrlCreateObj( $oExcelDoc, 15, 50 , 870 , 640 ) With $oExcelDoc .CommandBars("Full Screen").Visible = False .CommandBars("Standard").Enabled = False .CommandBars("Formatting").Enabled = False .CommandBars("Control Toolbox").Enabled = False .CommandBars("Drawing").Enabled = False .CommandBars("Forms").Enabled = False .CommandBars("Worksheet Menu Bar").Enabled = False .Application.DisplayFormulaBar = False EndWith EndIf ;~ $oExcelDoc.Close (0) ; Close the excel workbook - Save prompt will not open ;_ExcelBookClose($oExcelDoc) Edited December 14, 2010 by bartekd Share this post Link to post Share on other sites
bartekd 0 Posted December 14, 2010 Anybody have any ideas? Please Share this post Link to post Share on other sites
Melba23 3,455 Posted December 14, 2010 bartekd, Please do not bump your posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
Juvigy 49 Posted December 14, 2010 Did you try ? GUICtrlDelete ( $GUI_ActiveX) Share this post Link to post Share on other sites
bartekd 0 Posted December 14, 2010 thanks Melba23, i will keep this in mind next time. Juvigy, that seems to have worked. Thanks for your help. Share this post Link to post Share on other sites