Upgrade to 365 and not finding project or library

Craig1

Active Member
Joined
Jun 11, 2009
Messages
322
Hi Guys,
At wok ad we just upgraded to Office 365, the code below worked great before upgrade, but now I get a compile error to find the project or library on the word "Format" on the "sname" line.
It basically formats the date (A4) in a cell copies it and merges it with AM or PM from B4 2 on the right. Then saves as this new title. I just can't put my finger on it, even after searching the excel help on object browser.
Sorry about the code formatting, work restrictions for downloads.
Code:
Private Sub CommandButton3_Click()
Dim relativePath As String, sname As String
Dim Msg As String, Ans As Variant

On Error GoTo ErrorHandlerA:
     
    Msg = "Are you sure you want to save this Changeover as another sheet?"
    Ans = MsgBox(Msg, vbYesNo)
     
    Select Case Ans
         
    Case vbYes
        sname = Format(Range("A4").Value, "dd.mm.yyyy") & " " & Right(Range("B4").Value, 2) & ".xlsm"
    relativePath = Application.ActiveWorkbook.Path & "" & sname
    ActiveWorkbook.SaveAs Filename:=relativePath
         
    Case vbNo
GoTo Quit:
    End Select
     
Quit:
     
ErrorHandlerA:
    Exit Sub
         
End Sub

Thanks in advance.
 
Last edited by a moderator:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Have you looked in the VBE for missing references ?

ALT + F11 to open the VBE>>Tools>>References
Look for those marked missing and check.
 
Upvote 0
You don't need to download anything to format the code? Just add code tags.

In the VB Editor, click Tools - References and you should see one of the selected items that is prefixed with 'MISSING:'. Try unselecting it and compiling the project again.
 
Upvote 0
Thanks guys. It eventually worked after unticking the "missing" project. I had to do it a few times, save and close.

Thanks again.
Craig
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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