Access Beginner
Active Member
- Joined
- Nov 8, 2010
- Messages
- 311
- Office Version
- 2016
- Platform
- Windows
Hi,
I have the below code which was working at work using Excel 2010. We have upgraded to Office 2013 and it no longer works
Error: Compile Error. Cant find Project or Library
It does highlight this : If Right(varFile, 4) = ".xls" Then
I have the below code which was working at work using Excel 2010. We have upgraded to Office 2013 and it no longer works
Error: Compile Error. Cant find Project or Library
It does highlight this : If Right(varFile, 4) = ".xls" Then
Code:
Sub PropertyName_SAVEAS()
Sheets("Menu").Select
Range("I27").Select
Dim varFile As Variant
Dim strFileNameDefault As String
On Error Resume Next
With ActiveCell
If Not (.Address = "$I$27" And .Parent.Name = "Menu") Then
MsgBox "Please select the appropriate cell - See Text Source cell I27 on the Menu sheet"
Exit Sub
End If
If .Value = vbNullString Then
MsgBox "Please enter a value in cell ""I27""."
Exit Sub
End If
varFile = Application.GetSaveAsFilename(InitialFileName:=.Value, _
FileFilter:=" Excel Workbook (*.xlsx), *.xlsx," & _
" Excel 97-2003 Workbook (*.xls), *.xls,", _
FilterIndex:=1)
End With
If varFile <> False Then
If Right(varFile, 4) = ".xls" Then
ActiveWorkbook.SaveAs varFile, _
FileFormat:=xlExcel8
Else
ActiveWorkbook.SaveAs varFile, _
FileFormat:=xlOpenXMLWorkbook
End If
End If
End Sub