Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Run-Time Error '424': Object required when Saving Document

When I try to save a Document from a User Form Control Button I get the
following Error. It happens when you go to save the Document and hit Cancel.
If you save the Document it works perfect, but not when you Cancel it.

What I want to happen is the Message Pops Up. What did I do wrong & how do I
fix it?

Run-Time Error '424': Object required

' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Run-Time Error '424': Object required when Saving Document

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

Change the above line to:

Set bk = SaveAsFilename:=Application.GetSaveAsFilename(strF ile)

Then add this line:

bk.Save




"Brian" wrote in message
...
When I try to save a Document from a User Form Control Button I get the
following Error. It happens when you go to save the Document and hit
Cancel.
If you save the Document it works perfect, but not when you Cancel it.

What I want to happen is the Message Pops Up. What did I do wrong & how do
I
fix it?

Run-Time Error '424': Object required

' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Run-Time Error '424': Object required when Saving Document

Now I am getting this error message "Compile Error: Syntax Error". The Set bk
Line Turned Red.


' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

Set bk = SaveAsFilename:=Application.GetSaveAsFilename(strF ile) (Turned
Red)

bk.Save

Exit Sub

If FileToSave = False Then

MsgBox "The Save Method Failed, No Document Saved", , "C.E. Singleton
Co. of Florida, Inc."

End If

End Sub

"JLGWhiz" wrote:

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

Change the above line to:

Set bk = SaveAsFilename:=Application.GetSaveAsFilename(strF ile)

Then add this line:

bk.Save




"Brian" wrote in message
...
When I try to save a Document from a User Form Control Button I get the
following Error. It happens when you go to save the Document and hit
Cancel.
If you save the Document it works perfect, but not when you Cancel it.

What I want to happen is the Message Pops Up. What did I do wrong & how do
I
fix it?

Run-Time Error '424': Object required

' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

Thanks



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Run-Time Error '424': Object required when Saving Document

My error, too hasty. Correct that line to:

Set bk = Application.GetSaveAsFilename(strFile)


"Brian" wrote in message
...
Now I am getting this error message "Compile Error: Syntax Error". The Set
bk
Line Turned Red.


' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

Set bk = SaveAsFilename:=Application.GetSaveAsFilename(strF ile) (Turned
Red)

bk.Save

Exit Sub

If FileToSave = False Then

MsgBox "The Save Method Failed, No Document Saved", , "C.E. Singleton
Co. of Florida, Inc."

End If

End Sub

"JLGWhiz" wrote:

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

Change the above line to:

Set bk = SaveAsFilename:=Application.GetSaveAsFilename(strF ile)

Then add this line:

bk.Save




"Brian" wrote in message
...
When I try to save a Document from a User Form Control Button I get the
following Error. It happens when you go to save the Document and hit
Cancel.
If you save the Document it works perfect, but not when you Cancel it.

What I want to happen is the Message Pops Up. What did I do wrong & how
do
I
fix it?

Run-Time Error '424': Object required

' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

Thanks



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Run-Time Error '424': Object required when Saving Document

Have you declared bk as a general variable and assigned that to a workbook
object..or else try

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String
Dim bk As Workbook

Set bk = ActiveWorkbook

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

--
Jacob


"Brian" wrote:

When I try to save a Document from a User Form Control Button I get the
following Error. It happens when you go to save the Document and hit Cancel.
If you save the Document it works perfect, but not when you Cancel it.

What I want to happen is the Message Pops Up. What did I do wrong & how do I
fix it?

Run-Time Error '424': Object required

' Save Engineering Spec 11 Control Button

Private Sub Save_Engineering_Spec_11_Click()

Dim strFile As String

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile) (Error
Message)

If FileToSave = False Then

MsgBox "The Close Method Failed, No Document Saved", , "C.E.S."

Exit Sub

End If

End Sub

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object required Run-time error '424' Ayo Excel Programming 4 August 25th 09 05:36 PM
Run-time error '424': Object Required Doug Excel Programming 2 May 27th 09 11:56 PM
Run-time error '424': Object Required loren.pottinger Excel Programming 7 August 29th 06 03:16 PM
Run time error '424' object required Meltad Excel Programming 8 August 10th 06 09:34 AM
Run-time error '424': Object required Phil Bewig Excel Programming 3 February 1st 04 08:38 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"