Can I skip checking a file when I open a book programmatically?

I have an Excel file of approximately 100 MB in size that I open with this code that runs when the UserForm button is clicked:

Public Sub SelectButton_Click()
    fNameAndPath = Application.GetOpenFilename(Title:="Please Select a Report")
    If fNameAndPath = False Then Exit Sub
End Sub

Since this file is so large, it takes some time to verify it, and this confirmation is about half the time that my entire macro completes (I work in Excel 2013, and this file does not open from a network or shared drive). If I open the file manually, I get the opportunity to skip verification after three seconds of verification. The problem is that it opens the file in Protected View, where I cannot work with it.

Using VBA, is there a way to “skip skip” this reusable check while avoiding the Protected View?

When Excel is completely closed, this warning / landmark appears in the lower left corner of the splash screen:

enter image description here


When Excel is already open, this warning / guide will appear in the lower right corner:

enter image description here

+5
source share
1 answer

So far, there are two solutions that I have found useful to solve this problem, thanks to the comments above:

1. Disable Office verification for Excel files in the registry settings for Windows:

, VBA "", "", " Windows" "". IntelliSense, VBA:

Dim wsh As New WshShell
wsh.RegWrite "HKCU\Software\Microsoft\Office\15.0\Excel\Security\FileValidate\DisableEditFromPV", 0, "REG_DWORD"
Set wsh = Nothing

Excel 2013. Office Excel, - 15.0.

, Excel , , , Temp .

, Windows . :

2. Excel Microsoft Excel:

  1. VBA, , , .

    (, " Excel" C: \) , "", "" "":

    Selecting Options on the Excel File Menu

  2. " Excel" " " , Trust Center Settings, :

    enter image description here

  3. , Add new location... C:\Excel Files\ ( ; ), OK. , .

    enter image description here

+2

Source: https://habr.com/ru/post/1668758/


All Articles