LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Closing a file

Hi,

I am using this for importing some sheets from a workbook. After importing
the file must be closed.

Sub importerendb()
Range("rekenvel!E2").Value = Range("rekenvel!b13").Value & "\" &
importeren.databasescombo.Value & ".xls"
Dim bestandsnaam
bestandsnaam = Range("rekenvel!E2").Value
Workbooks.Open Filename:=bestandsnaam, Password:="XYZ"
For Each n In ActiveWorkbook.Names
n.Delete
Next
Sheets(Array("lijstkerken", "database")).Move Befo=Workbooks( _
"myfile.xls").Sheets(1)
Workbooks(bestandsnaam).Close savechanges:=False
Unload importeren
End Sub

It goes wrong in the line "Workbooks(bestandsnaam).Close savechanges:=False"

What am I doing wrong?

Thanks for help, Gert-Jan

 
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
Open external data (varying file names) and closing file once data is retrieved Corrie Excel Programming 2 December 31st 06 09:56 PM
Closing a db file getting errors don Excel Programming 0 May 26th 06 01:09 AM
VBA Closing File John Viall[_2_] Excel Programming 3 April 7th 05 03:49 PM
VBA closing one file colic Excel Programming 2 September 25th 03 05:16 PM


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