Good morning
I'm looking to move my files into Sharepoint, some of which contain macros.
I did some initial testing in October (where I created a simple "add timestamp to sheet2") and it looked to work fine (opening the file in desktop version, running the vba, then saving the file) but in revisiting it now I get the following error:
Compile error: can't find project or library
This looks to hit every variable. When I declare my variables with dim, the error won't occur, but I get the error on functions like Format, which I'm unable to declare.
Example code below:
Has anyone else experienced this? I'm struggling with ideas on how to fix!
Thank you in advance
I'm looking to move my files into Sharepoint, some of which contain macros.
I did some initial testing in October (where I created a simple "add timestamp to sheet2") and it looked to work fine (opening the file in desktop version, running the vba, then saving the file) but in revisiting it now I get the following error:
Compile error: can't find project or library
This looks to hit every variable. When I declare my variables with dim, the error won't occur, but I get the error on functions like Format, which I'm unable to declare.
Example code below:
VBA Code:
Sub test1()
output.Select
lrow = Cells(Rows.Count, 1).End(xlUp).Row
Range("a" & lrow + 1).Value = Format(Now(), "DDMMYY HH:MM:SS")
Sheets("output").Copy
Dim SharePointURL As String
Dim FileName As String
SharePointURL = "https://sharepoint.com/sites/AutomationTest/Shared%20Documents/Test%20macro%20environment/Outputs%20sent%20to%20here/"
FileName = "test output copy.xlsx"
ActiveWorkbook.SaveAs SharePointURL & FileName
ActiveWorkbook.Close SaveChanges:=False
Instructions.Select
MsgBox "Macro completed"
Exit Sub
End Sub
Has anyone else experienced this? I'm struggling with ideas on how to fix!
Thank you in advance