Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Macro, how can I check if an opened workbook was changed ?

please help. I have in a VBA project a Workbook that opens 13 other
workbooks, and at end must close them all. At the moment my instructions to
the Main workbook is to save them all, and this is costing a lot of time when
I am waiting for the files to be saved. now I want to change to a situation
where the workbook closes the files that were not changed, and only save the
one that has been changed.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Using Macro, how can I check if an opened workbook was changed ?

Dim wkbk As Workbook
On Error Resume Next
For Each wkbk In Workbooks
wkbk.Save
wkbk.Close
Next

"Macro to check if a workbook has changed" wrote:

please help. I have in a VBA project a Workbook that opens 13 other
workbooks, and at end must close them all. At the moment my instructions to
the Main workbook is to save them all, and this is costing a lot of time when
I am waiting for the files to be saved. now I want to change to a situation
where the workbook closes the files that were not changed, and only save the
one that has been changed.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Using Macro, how can I check if an opened workbook was changed ?

Dim oWB As Workbook
On Error Resume Next
For Each oWB In Application.Workbooks
If Not oWB.Saved Then oWB.Save
oWB.Close
Next


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Macro to check if a workbook has changed" <Macro to check if a workbook has
wrote in message
...
please help. I have in a VBA project a Workbook that opens 13 other
workbooks, and at end must close them all. At the moment my instructions

to
the Main workbook is to save them all, and this is costing a lot of time

when
I am waiting for the files to be saved. now I want to change to a

situation
where the workbook closes the files that were not changed, and only save

the
one that has been changed.



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
Macro in Excel to check if another workbook is opened. Catalin[_3_] Excel Programming 3 August 5th 06 07:31 AM
How to check workbook is already opened before passing the workbook obj to a subroutine in Word Bon Excel Programming 2 January 19th 06 09:54 AM
Looking for a way to run a macro when the workbook is opened Bob Reynolds[_3_] Excel Programming 3 September 25th 04 02:58 PM
Check if workbook has been changed Jake Marx[_3_] Excel Programming 0 April 30th 04 06:24 PM
Code to check if workbook is the last one opened KimberlyC Excel Programming 1 February 13th 04 12:04 AM


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