Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default runtime error '1004' application or object defined error. Please help

I'm trying to use a macro to select the first blank cell in a column
(amongst other things), but keep getting this error. Here is the code:

Sub Tfr_to_DB()
Select Case Application.MailSystem
Case xlMAPI
Dim wb As Workbook
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SendMail "...@...", _
"Fee Book - " & Range("B1")
.Close False
End With

Case xlNoMailSystem
MsgBox "no mail client"

Case Else
Application.CommandBars("worksheet menu bar") _
.Controls("File").Controls("Send To").Controls("Mail
Recipient...").Execute

End Select

Application.ScreenUpdating = True


Range("A4:g16").Select
Selection.Copy


Worksheets("Database").Activate
Dim ws As Worksheet
Set ws = Worksheets("Database")
With ws
.Range("A1").End(xlDown).Offset(1, 0).Select
'ERROR IS HERE

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Columns("A:G").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Header:
=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select

End With

Sheets("New Invoices").Select
ActiveWindow.ScrollRow = 1
Range("A4:f16").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-9
Range("A4").Select
End Sub

You can probably tell I'm a novice.

Any help is appreciated.

deej

--
Posted via a free Usenet account from http://www.teranews.com

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
runtime error '1004' application or object defined error Janis Excel Programming 4 November 18th 09 03:01 PM
Runtime Error 1004: Application defined or object defined error Access n00b Excel Programming 2 April 5th 06 02:58 AM
Runtime error 1004- application defined or object defined error Novice Excel Programming 11 February 6th 06 11:02 PM
Runtime error 1004- application defined or object defined error Jim Thomlinson[_5_] Excel Programming 0 February 6th 06 09:33 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 08:36 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"