Excel Only run macro if file exists? from Mr Excel


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Only run macro if file exists?
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

kertappa
Welcome to the Board


Joined: 02 Apr 2004
Posts: 2
Location: London, UK
Flag: England

Status: Offline

 Reply with quote  

Only run macro if file exists?

Hello everyone, please can someone help me with the following..?

I have a simple macro to open a seperate file and copy over some data.
The macro is repeated several times for different files, six in total.
Now I am trying to create a macro to run each of the six 'copy' macros, but to only run each macro if the relevent file exists. So if the file does not exist, it will not try to open it and copy the data over...

Can someone pls let me know if this is possible?

Thanks

Post Fri Apr 02, 2004 10:01 pm 
 View user's profile Send private message Visit poster's website

btadams
Board Master


Joined: 07 Jan 2003
Posts: 533
Location: Richmond, Va
Flag: Usa

Status: Offline

 Reply with quote  

Re: Only run macro if file exists?

Welcome to the board!


Check out this link:

http://www.exceltip.com/show_tip/Files,_Workbook,_and_Worksheets_in_VBA/Determine_if_a_workbook_exists_using_VBA_in_Microsoft_Excel/471.html
_________________
Being a statistician means never having to say you're certain!

Post Fri Apr 02, 2004 10:27 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.