Hi
I'm hopping somebody can help me to move forward with my code
I get the above error when trying to run the below code
It errors at this line:
Workbooks.Open Filename:=SelectedFile
When I select "End" or "Debug" the error, the file opens but the code stops running
This code is part of a biger one. And you can see when the file gets open I Call for another sub to copy the data from open file to ThisWorkbook, but I cannot get to that point because I'm stuck at opening the files.
Alos, just for information, the files that I'm opening have their own macro in it (not needed for this purposes) and may or may not be a large files. The files stored in shared folder. I need to copy data from one tab in each file to summurise all in ThisWorkbook. But as I'm saying the errors stops me from moving forward.
Thank you
Option Explicit
Dim VendorReconciliationSummary As Workbook
Dim VendorReconciliationIndividual As Workbook
Dim SelectedFile As Variant
Sub APweeklyReport()
Set VendorReconciliationSummary = ThisWorkbook
Application.ScreenUpdating = False
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Choose data files to load..."
.AllowMultiSelect = True
.Filters.Clear
If .Show = -1 Then
For Each SelectedFile In .SelectedItems
MsgBox (SelectedFile) 'just to check
Set VendorReconciliationIndividual = ActiveWorkbook
Workbooks.Open Filename:=SelectedFile
Call CopyVendorRecIndividualtoSummary
VendorReconciliationIndividual.Close SaveChanges:=False
Next SelectedFile
Else
End If
End With
End Sub