PC Review


Reply
Thread Tools Rate Thread

'1004' - Application defined or Object defined

 
 
=?Utf-8?B?T2xkamF5?=
Guest
Posts: n/a
 
      16th Oct 2006


I get this error at "ActiveWorkbook.SaveCopyAs Filename:=jobsave"


Private Sub CommandButton4_Click() 'Save time sheet
Dim jobname As String
Dim jobemployee As String
Dim Jobdate As String
Dim jobnumber As String
Dim jobsave As String


Jobdate = Range("C10").Value ' set date format to mm-dd-yy

Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)
jobname = Range("D6")
jobemployee = Range("E3")
jobnumber = Range("D4")

jobsave = InputBox("Please enter TIME SHEET file name to save",
" Process Technology", "" & "C:Time Sheets\ " + jobnumber + " " +
jobemployee + " " + (Jobdate))
If jobsave = "" Then

Range("A1").Select
Range("D3").Select

Else
ActiveWorkbook.SaveCopyAs Filename:=jobsave

On Error GoTo ErrorHandler:
Range("A1").Select
Range("D3").Select
End If
ErrorHandler:

Range("A1").Select
Range("D3").Select

End Sub

oldjay
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2xkamF5?=
Guest
Posts: n/a
 
      16th Oct 2006
Corrected but it still doesn't work

jobsave = InputBox("Please enter TIME SHEET file name to save",
> " Process Technology", "" & "C:\Time Sheets\ " + jobnumber + " " +
> jobemployee + " " + (Jobdate))


"Oldjay" wrote:

>
>
> I get this error at "ActiveWorkbook.SaveCopyAs Filename:=jobsave"
>
>
> Private Sub CommandButton4_Click() 'Save time sheet
> Dim jobname As String
> Dim jobemployee As String
> Dim Jobdate As String
> Dim jobnumber As String
> Dim jobsave As String
>
>
> Jobdate = Range("C10").Value ' set date format to mm-dd-yy
>
> Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)
> jobname = Range("D6")
> jobemployee = Range("E3")
> jobnumber = Range("D4")
>
> jobsave = InputBox("Please enter TIME SHEET file name to save",
> " Process Technology", "" & "C:Time Sheets\ " + jobnumber + " " +
> jobemployee + " " + (Jobdate))
> If jobsave = "" Then
>
> Range("A1").Select
> Range("D3").Select
>
> Else
> ActiveWorkbook.SaveCopyAs Filename:=jobsave
>
> On Error GoTo ErrorHandler:
> Range("A1").Select
> Range("D3").Select
> End If
> ErrorHandler:
>
> Range("A1").Select
> Range("D3").Select
>
> End Sub
>
> oldjay

 
Reply With Quote
 
=?Utf-8?B?T2xkamF5?=
Guest
Posts: n/a
 
      16th Oct 2006
I found my dumb mistake

"Oldjay" wrote:

> Corrected but it still doesn't work
>
> jobsave = InputBox("Please enter TIME SHEET file name to save",
> > " Process Technology", "" & "C:\Time Sheets\ " + jobnumber + " " +
> > jobemployee + " " + (Jobdate))

>
> "Oldjay" wrote:
>
> >
> >
> > I get this error at "ActiveWorkbook.SaveCopyAs Filename:=jobsave"
> >
> >
> > Private Sub CommandButton4_Click() 'Save time sheet
> > Dim jobname As String
> > Dim jobemployee As String
> > Dim Jobdate As String
> > Dim jobnumber As String
> > Dim jobsave As String
> >
> >
> > Jobdate = Range("C10").Value ' set date format to mm-dd-yy
> >
> > Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)
> > jobname = Range("D6")
> > jobemployee = Range("E3")
> > jobnumber = Range("D4")
> >
> > jobsave = InputBox("Please enter TIME SHEET file name to save",
> > " Process Technology", "" & "C:Time Sheets\ " + jobnumber + " " +
> > jobemployee + " " + (Jobdate))
> > If jobsave = "" Then
> >
> > Range("A1").Select
> > Range("D3").Select
> >
> > Else
> > ActiveWorkbook.SaveCopyAs Filename:=jobsave
> >
> > On Error GoTo ErrorHandler:
> > Range("A1").Select
> > Range("D3").Select
> > End If
> > ErrorHandler:
> >
> > Range("A1").Select
> > Range("D3").Select
> >
> > End Sub
> >
> > oldjay

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application-Defined or object defined error 1004 When ran on exel97 but not 2003 bornweb Microsoft Excel Programming 0 17th Feb 2007 11:30 PM
Another 1004 Application-defined or Object -defined Error problem DatixRon via OfficeKB.com Microsoft Excel Crashes 3 18th Sep 2006 12:25 PM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?Tm92aWNl?= Microsoft Excel Programming 0 6th Feb 2006 09:34 PM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?Tm92aWNl?= Microsoft Excel Programming 1 6th Feb 2006 09:33 PM
RE: Runtime error 1004- application defined or object defined erro =?Utf-8?B?SmltIFRob21saW5zb24=?= Microsoft Excel Programming 0 6th Feb 2006 09:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 PM.