Disabling [DataSource.NotFound] Folder or File not found: Could not find a part of the path

Nelsini

New Member
Joined
May 13, 2021
Messages
25
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
  2. MacOS
Hello!

We're migrating a file from W10 to MacOS and it contains some power queries and pivot tables. When I open the file it gives me this alert - [DataSource.NotFound] Folder or File not found: Could not find a part of the path - regarding the files from Windows due to not finding them.

I'm trying to make this file both MacOS and W10 compatible and I've created some macros to replace the power query on MacOS which work fine, but I wanted to disable this alert or even the connections to the files from W10 on MacOS since we won't use them in that environment.

The code I have now is as follows:

VBA Code:
Private Sub Workbook_Open()
    Dim OS As String
    OS = Application.OperatingSystem
    
    If OS Like "*Mac*" Then
        
        With Application
        .DisplayAlerts = False
        .AlertBeforeOverwriting = False
        .Wait (Now + TimeValue("0:00:03"))
        
        .DisplayAlerts = True
        .AlertBeforeOverwriting = True
        End With
        
    Else
    
        MsgBox ("Testing for Windows")
    
    End If
    
End Sub

Any help is appreciated and thank you in advance!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top