LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Enable Option Button if File Exists

I have employees that open up five monthly reports each night after midnight
numbers are collected for the day. The reports names have the format of
yy-mmrpt.xls. So for example two reports for Jan '08 would be 08-01tss.xls
and 08-01po4.xls. We have reports dating back to 2001.
I amended the userform used to select the files by adding a spinner to
select the year and gave it a range of 2001 - current year + 1. The form's
Activate event initializes the spinner to the current year and sets the
spinner max. (Before adding the spinner, someone needed to enter VBA and
change a string variable to select the year.) The month and report id are
picked by radio buttons and check boxes respectively
I need to add some error handling code for this (they've created a set of
files for 2008, but the spinner will choose future files that have yet to be
created after new year's day).
I've thought a simple msgbox "file not found" in the error code would work,
but a more elegant solution would be to check which files exists and disable
the check box for any report if no report exist for the implied month (via
radio button) and year (via spinner). I actually have a similar problem for
earlier years... the first few years we had four reports. So I have a
07-01SHF.xls file but I don't have a 04-01SHF.xls file.

So in short, I'd like to find out if a file exists via VBA and prevent the
user from asking for it if it ain't there.
Any suggestions would be appreciated.
Peace.
EQ

 
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 do I enable 'insert copied cells' (option not available in men Excel Amateur Excel Discussion (Misc queries) 1 May 24th 06 08:07 AM
Enable target frame option Ian Excel Discussion (Misc queries) 0 April 6th 06 05:05 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
Where is menu option to enable macros? dc1995 Excel Discussion (Misc queries) 1 January 19th 06 08:01 PM
How can I enable the "Record Using Relative References" option in. cbaugher Excel Discussion (Misc queries) 1 January 31st 05 03:32 PM


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