A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You will get this error if the sheet is hidden or cannot be selected for some other reason.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Why am I getting the above error on the highlighted code line?
Sub copy_currentFile(currFilePath As Variant)
If (currFilePath Like "*Shipped Delivered*") Or (currFilePath Like "*BudgetTracker*") Or _
(currFilePath Like "*Overton Report*") Then
Workbooks.Open Filename:=currFilePath, ReadOnly:=True, UpdateLinks:=False
With ActiveWorkbook
If (currFilePath Like "*Shipped Delivered*") Then
.Sheets(1).Select <+++++++ ElseIf (currFilePath Like "*Budget Tracker*") Then
.Sheets("BUDGET DETAIL").Select
ElseIf (currFilePath Like "*Overton Report*") Then
.Sheets("CASPR01 - Milestone Export").Select
End If
.ActiveSheet.Copy before:=ThisWorkbook.Sheets(1)
Application.DisplayAlerts = False
.Close
End With
End If
End Sub
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
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.
Answer accepted by question author
You will get this error if the sheet is hidden or cannot be selected for some other reason.