Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Closing File

Two questions:
1. I have a VBA app, that opens two files, merges the important data into
one, then closes the file I don't need anymore. How can I get it to stop
prompting me to save it, and to not ask me about the large amount of data
left on the clipboard?

2. I know this isn't the right forum, but since I'm asking a question
already, here goes. I wrote a VBA app in word to open an Excel file, load
the data into an array, but it won't unload the excel file from memory. If I
look at the task manager, the file is still open. (in the process of
building this new app, I may have already figured this out, but haven't had
the time to try it.)

Thanks in advance.
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA Closing File

John,

1.
This will stop the closing prompt
ActiveWorkbook.Close false

this may stop the clipboard prompt. Not entirely sure though.
application.displayalerts = false

2.
You might need to show your code, but it should be something like
Sub Test()
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.application")
'do something with your excel object
Set objExcel = Nothing
End Sub

Robin Hammond
www.enhanceddatasystems.com

"John Viall" wrote in message
...
Two questions:
1. I have a VBA app, that opens two files, merges the important data into
one, then closes the file I don't need anymore. How can I get it to stop
prompting me to save it, and to not ask me about the large amount of data
left on the clipboard?

2. I know this isn't the right forum, but since I'm asking a question
already, here goes. I wrote a VBA app in word to open an Excel file, load
the data into an array, but it won't unload the excel file from memory.
If I
look at the task manager, the file is still open. (in the process of
building this new app, I may have already figured this out, but haven't
had
the time to try it.)

Thanks in advance.
John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default VBA Closing File

1. set
Application.DisplayAlerts = FALSE
befor ethe code that closes the file

2. make sure that you have code like
( assuming XLApp is dim's as the Excel Application object)

XLApp.Quit
SET XLApp = Nothing

Exel DOES have a problem releasing memory until its quit. I wonder if Word
has a similar issue? Haven't searched the KB, but it wouldn't surprise me as
many Office components get shared amonst the Office applications.


"John Viall" wrote:

Two questions:
1. I have a VBA app, that opens two files, merges the important data into
one, then closes the file I don't need anymore. How can I get it to stop
prompting me to save it, and to not ask me about the large amount of data
left on the clipboard?

2. I know this isn't the right forum, but since I'm asking a question
already, here goes. I wrote a VBA app in word to open an Excel file, load
the data into an array, but it won't unload the excel file from memory. If I
look at the task manager, the file is still open. (in the process of
building this new app, I may have already figured this out, but haven't had
the time to try it.)

Thanks in advance.
John

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Closing File

Both worked, thanks.

"Patrick Molloy" wrote:

1. set
Application.DisplayAlerts = FALSE
befor ethe code that closes the file

2. make sure that you have code like
( assuming XLApp is dim's as the Excel Application object)

XLApp.Quit
SET XLApp = Nothing

Exel DOES have a problem releasing memory until its quit. I wonder if Word
has a similar issue? Haven't searched the KB, but it wouldn't surprise me as
many Office components get shared amonst the Office applications.


"John Viall" wrote:

Two questions:
1. I have a VBA app, that opens two files, merges the important data into
one, then closes the file I don't need anymore. How can I get it to stop
prompting me to save it, and to not ask me about the large amount of data
left on the clipboard?

2. I know this isn't the right forum, but since I'm asking a question
already, here goes. I wrote a VBA app in word to open an Excel file, load
the data into an array, but it won't unload the excel file from memory. If I
look at the task manager, the file is still open. (in the process of
building this new app, I may have already figured this out, but haven't had
the time to try it.)

Thanks in advance.
John

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
Closing file with macro dwake Excel Discussion (Misc queries) 3 December 2nd 09 05:49 PM
Cannot find file upon closing jhicsupt Excel Discussion (Misc queries) 1 December 3rd 07 12:23 PM
How to skip the save file notoification on file closing? Dan Excel Worksheet Functions 1 August 19th 07 02:26 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
VBA closing one file colic Excel Programming 2 September 25th 03 05:16 PM


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