Cannot find Project or Library

stroffso

Board Regular
Joined
Jul 12, 2016
Messages
160
Office Version
  1. 365
Platform
  1. Windows
I have some code which has always ran perfectly but have recently started getting this error. Has anyone any ideas what is going wrong? The error is highlighted at the Password = Inputbox row.

I have two files with this code in and one works and one doesnt so im presuming I have messed up something in the back end?


Sub UnhideAllSheets()
Dim ws As Worksheet
Dim sht As Object
Dim myPassword As String

myPassword = "Resting4444" ' Set password here

Password = InputBox("Enter Password")
Application.ScreenUpdating = False
If Password = "" Then Exit Sub ' Exit if null input or cancel

' Incorrect password
If Password <> myPassword Then
MsgBox Title:="Warning", Prompt:="Incorrect Password"
Exit Sub
End If

For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Sheets("Data").Select
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Apologies all I have found the issue in the references section, looks like some bit went haywire, anyone any ideas on how to stop this happening again?
 
Upvote 0
The Missing bit in references was this, not sure if it helps. It looks like its due to using different machines to open the files

AdhocreportingExcelclientlib
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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