LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 9
Default If WB not there; give message: What am I doing wrong?

Sub DEC_NY_AutoShape22_Click()
'
' AutoShape21_Click Macro
' Macro recorded 8/31/2009 by Rick Green
'
Application.ScreenUpdating = False
'
'Dim wb As Workbook
'On Error Resume Next
'Set wb = ActiveWorkbook.Worksheets("DEC")
'On Error GoTo 0
'If wb Is Nothing Then
' MsgBox "Year not active for this month."
'Else
ChDir _
"C:\Documents and Settings\RICK\My Documents\Calendar\Y2010"
Workbooks.Open Filename:= _
"C:\Documents and Settings\RICK\My Documents\Calendar\Y2010\DEC.xls"
Application.Run "DEC.xls!backtotop"
'End If

End Sub

I have a workbook named Months:
12 months and arrows which either refers to year 2009, 2010, or 2011. I
have not work on 2011 and only started to work on few of the 2010. If these
workbooks are not in the location specified by the macro, I want it to state
that workbook for that year has not been created and go back to the workbook
call "Months".

I have searched various references and thought this maybe the correct code,
apparently I am wrong.... Can someone please help me.

Thanks,
Rick

 
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
Error Message :A value used in the formula is of the wrong data ty Graham Excel Worksheet Functions 4 June 16th 09 03:51 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
"Document not saved" message. What is wrong? Phil Excel Discussion (Misc queries) 1 June 27th 07 04:44 PM
How to give an error message if a cell value entered is larger than permitted Colin Hayes Excel Discussion (Misc queries) 7 May 16th 07 02:39 PM
Give RELEVANT responses to questions. DO NOT give usless list pmartin Excel Worksheet Functions 2 July 6th 06 06:08 PM


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