Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
don don is offline
external usenet poster
 
Posts: 15
Default Closing a db file getting errors

I am getting errors trying to close down a dbase file.
In the code below:
at the line Windows(filename).activate
I get a Run-time error '9' subscript out of range.
I think that is because windows only works on .xls files but that is
only a guess on my part.
at the line Filename.Delete
I get a run-time error '424' subscript out of range.
I beleive somehow I need to close the file before deleting it.
Thanks in advance for any help.
Don


Workbooks.Open Filename:="C:\My Documents\export.dbf"
Filename = "C:\My Documents\export.dbf"
' do stuff here
Application.DisplayAlerts = False
Windows(Filename).Activate ' Close down imported file before exiting
ActiveWorkbook.Close
Application.DisplayAlerts = True
Filename.Delete
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
How to skip the save file notoification on file closing? Dan Excel Worksheet Functions 1 August 19th 07 02:26 PM
VBA Closing File John Viall[_2_] Excel Programming 3 April 7th 05 03:49 PM
Propogating errors after closing Workbook. Randy MacDonald Excel Programming 2 January 7th 04 12:31 PM
closing a file without saving matt dunbar Excel Programming 3 November 25th 03 06:29 PM
VBA closing one file colic Excel Programming 2 September 25th 03 05:16 PM


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

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"