Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Joel - The DBF Solved

Joel...trying to use the Filter resulted in the errors we discussed previously.

Code like this worked..Thank you for your Help.

Private Sub SaveGoCSV()
Dim BkName$, CCName$, LastRow$, M$, DBFName$
Dim objXLApp As Object 'Excel.Application
Dim Wb As Object, Wb2 As Object 'Excel.Workbook
Dim objXLSheet As Object 'Excel.Worksheet
On Error GoTo AAA1

BkName = "C:\Stores\" & cboADBF

Set Wb = Workbooks.Open(filename:=BkName)
'create workbook to copy filtered data
Set Wb2 = Workbooks.Add(template:=xlWBATWorksheet)

With Wb.Sheets(2)
'create new filename to save file
DBFName = Replace(cboADBF, "xls", "dbf")
CCName = "C:\Stores\" & DBFName
If Dir(CCName) < "" Then Kill CCName
.SaveAs filename:=CCName, FileFormat:= _
xlDBF4, CreateBackup:=False
End With

Wb.Close savechanges:=False
Wb2.Close savechanges:=False
AAA2:
Exit Sub
AAA1:
Select Case Err
Case Else
MsgBox "Error Number " & Err.Number & " " & Err.Description: Resume AAA2
End Select
End Sub

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
Joel - The DBF4 Bob Barnes Excel Programming 1 November 19th 09 02:43 AM
Joel, Need your help fi.or.jp.de Excel Programming 1 October 20th 09 05:32 PM
Format Code - Joel LiAD Excel Programming 1 May 4th 09 11:51 AM
Question for Joel K[_2_] Excel Programming 1 March 12th 09 06:46 PM
Joel, Would you contact me on your reply please? Thanks Somewhere In Excel 2002 Excel Programming 2 August 25th 07 09:22 PM


All times are GMT +1. The time now is 04:35 AM.

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

About Us

"It's about Microsoft Excel"