B
Brian
This code worked perfect when it was in the User Form Code Window, but I
moved it to a module and I get a Run Time Error "424' Object Required
Code in the User Form Window
--------------------------------------------------
'*******************************************************
'Save Installer Forms 11 Control Button
'Located in M3_Save_Workbook
'*******************************************************
Private Sub Save_Installer_Forms_11_Click()
Call Save_Installer_Forms
End Sub
Code Located in the module:
Declarations
----------------------------------------
Dim strFile As String
Dim fileSaveName As Variant
Dim myMsg As String
'Save Installer Forms 11 Control Button
Sub Save_Installer_Forms()
' Dim strFile As String
' Dim fileSaveName As Variant
' Dim myMsg As String
strFile = "FORMS " & CLLI_Code_1.Value _ "This Block Turns Yellow"
& Space(1) & TEO_No_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value
fileSaveName = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
fileFilter:="Excel Macro-Enabled Workbook(*.xlsm),(*.xlsm")
If fileSaveName <> False Then
ActiveWorkbook.SaveAs Filename:= _
fileSaveName, _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, _
CreateBackup:=False
Else
MsgBox prompt:=Engineer_2.Value & vbLf & "You canceled saving the
Installer Form." & vbCrLf & _
"Installer Form was not Saved.", _
Title:="C.E.S."
End If
End Sub
moved it to a module and I get a Run Time Error "424' Object Required
Code in the User Form Window
--------------------------------------------------
'*******************************************************
'Save Installer Forms 11 Control Button
'Located in M3_Save_Workbook
'*******************************************************
Private Sub Save_Installer_Forms_11_Click()
Call Save_Installer_Forms
End Sub
Code Located in the module:
Declarations
----------------------------------------
Dim strFile As String
Dim fileSaveName As Variant
Dim myMsg As String
'Save Installer Forms 11 Control Button
Sub Save_Installer_Forms()
' Dim strFile As String
' Dim fileSaveName As Variant
' Dim myMsg As String
strFile = "FORMS " & CLLI_Code_1.Value _ "This Block Turns Yellow"
& Space(1) & TEO_No_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value
fileSaveName = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
fileFilter:="Excel Macro-Enabled Workbook(*.xlsm),(*.xlsm")
If fileSaveName <> False Then
ActiveWorkbook.SaveAs Filename:= _
fileSaveName, _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, _
CreateBackup:=False
Else
MsgBox prompt:=Engineer_2.Value & vbLf & "You canceled saving the
Installer Form." & vbCrLf & _
"Installer Form was not Saved.", _
Title:="C.E.S."
End If
End Sub