If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Compile Error Sub or Function Not Defined . . .

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-27-10, 19:19
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Compile Error Sub or Function Not Defined . . .

Here is the code:
Code:
Private Sub Command117_Click()
'Kill the old xls file
On Error Resume Next
Kill "D:\flw\Access\qryLACustProg.xls"
On Error GoTo 0
'Export the CURRENT data
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "qryLaCustProg", "D:\flw\Access\", True
MsgBox ("Finished Exporting qryLACustProg to D:\FLW\ACCESS\")
EndSub
I'm going screwy on this when comparing it to other code that works!

Thanks . . . Rick
Reply With Quote
  #2 (permalink)  
Old 08-28-10, 13:40
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi Rick,

The last line of the code:
Code:
EndSub
should be two words:
Code:
End Sub
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On