Results 1 to 3 of 3

Thread: Open Excel and avoid dialog boxes

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2013
    Location
    Minneapolis, MN
    Posts
    531

    Open Excel and avoid dialog boxes

    Hello:

    I have this very simple code to open a document.

    This call opens the workbook...
    Code:
    xlsWorkBook = xlsWorkBooks.Open(FilePath, True)

    When running this, a dialog box comes up saying "We can't update some of the links in your workbook right now. You can continue without updating their values, or edit the links you think are wrong."

    What I need is an Alt-C to say 'Continue" without updating. In this open command, I do not see an option for that.


    Code:
    Imports Microsoft.Office.Interop.Excel
    
    Module Module1
        Sub Main()
            Dim xlsApp As Microsoft.Office.Interop.Excel.Application = Nothing
            Dim xlsWorkBooks As Microsoft.Office.Interop.Excel.Workbooks = Nothing
            Dim xlsWorkBook As Microsoft.Office.Interop.Excel.Workbook
            Dim FilePath As String = "U:\Company Job Log\Master Production Job Log.xlsm"
            Dim xlsWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
    
            Try
                xlsApp = New Microsoft.Office.Interop.Excel.Application
                xlsApp.Visible = True
                xlsWorkBooks = xlsApp.Workbooks
                xlsWorkBook = xlsWorkBooks.Open(FilePath, True)
    
                xlsWorkSheet = xlsWorkBook.Worksheets(1)
    
            Catch
    
            End Try
    
        End Sub
    
    End Module
    Thanks!
    - A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!

  2. #2
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,048

    Re: Open Excel and avoid dialog boxes

    well you can use..
    Code:
       
     xlsApp.DisplayAlerts = False
    but are you sure that you want to disable warnings?
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2013
    Location
    Minneapolis, MN
    Posts
    531

    Re: Open Excel and avoid dialog boxes

    Excellent, Thanks!
    - A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width