A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi,
This issue might be occurred due to missing library. Have u checked the same at Tools>ReferencesIn VBA.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear All,
I am trying to run a VBA macro that saves a file with the .xlsm extension. When I run the macro (via a command button: SAVE FILE), I get the following Compileerror:
Can't find project or library
When I press OK to view the debug screen, I can see that the first Format instruction in the following code highlighted:
Sub SAVE_FILE()
Dim vFile
vFile = Application.GetSaveAsFilename(Format(Worksheets("Price Desk Form").Range("A6").Value) & " - Price Desk Worksheet" & Format(Date, " - mmmm yyyy"), "Excel files (*.xlsm),*.xlsm")
If TypeName(vFile) = "Boolean" Then Exit Sub ' user cancelled
ActiveWorkbook.SaveAs vFile, FileFormat:=52
End Sub
Now, I have been running this VBA for several years now. The only difference is that I now have a new computer. Both the computers use Excel 2010 in Windows 7. So, I am not sure why I am now getting this message. The same .xlsm file works in my co-workers' computers.
I have a series of macros in this file and so am not sure if the code shown above is the initial trigger for the compile error. I think it is as this particular macro is the first set of instruction that I would do - i.e. save the file as a .xlsm.
Hope you can provide me with some tips. Thank you.
Regards,
Sam.
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.
Hi,
This issue might be occurred due to missing library. Have u checked the same at Tools>ReferencesIn VBA.