Share via

excel application visible behavior

Anonymous
2015-06-05T19:28:45+00:00

I am using code to manipulate the workbooks visible property in an excel application that has 2 workbooks.  In version 2003 the application.visible respected the workbook.visible propterties and displayed only the workbooks where visible = true.  In 2013 excel the application.visible (which is the only way to get the spreadsheet to the screen (screenupdating property does not display to the screen) ) makes all workbooks visible regardless of whether their visible property is true or false.  I need this to function as it did in excel 2003.  Please advise.  Thanks.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2016-04-02T15:16:49+00:00

    I found my problem...my devel computer has AMD Catalyst control center which manages my dual monitors. 

    I open the control center from a right click on the screen and made sure both the Desktop Manager and HydraGrid where disabled.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-04-02T14:30:11+00:00

    I am having this problem in reverse.  I am opening a 2013 Excel document, updating the contents and saving the document as a pdf file for view by the end user.  I don't want the user to see Excel while the contents are being updated and saved as a pdf.  The following code used to work when using the 2010 Excel interop object and XP.

                xlApp = new Excel.Application();

                xlApp.Visible = false;

    After updating to Win7 and updating from 2010 Excel to 2013 Excel this problem appeared.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-06-06T13:53:12+00:00

    Norman -

    (xcelapp is an instance of excel - it contains 2 workbooks with multiple worksheets)

        xcelapp.visible = false

        xcelapp.windows(1).workbooks(1).visible = false

        xcelapp.windows(1).workbooks(2).visible = true

    the next command is the only way to bring the spreadsheet to the screen

        xcelapp.ScreenUpdating = True

        xcelapp.Visible = True

    this code works in office 2003 - it only shows one workbook.  In 2013 it shows both workbooks - all the worksheets are either hidden or shown properly withing the workbooks, but that is irrelevant if i can't show one workbook and not the other.

    Any thoughts?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2015-06-05T20:13:43+00:00

    Hi Amanda,

    Using the instruction Application.Visible = Fals e will hide Excel and, therefore, any open workbooks. Additionally, I do not think that the workbook object has a Visible property.

    Perhaps you are looking for something like:

    '==========>>

    Option Explicit

    '--------->>

    Public Sub ToggleWorkbookVisibility()

        Dim WB As Workbook

        Const sWorkbookName As String = "MyBook.xlsx"                   '<<=== Change to suit

        Set WB = Application.Workbooks(sWorkbookName)

        With Application.Windows(WB.Name)

            .Visible = Not .Visible

        End With

    End Sub

    '<<=========

    ===

    Regards,

    Norman

    Was this answer helpful?

    0 comments No comments