Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Error handler not handling

Hi:

I created an error handler to create a directory if the path wasn't
found, and it has stopped working. I'm not sure why it is not going to
the Handler now.

DestBk is a workbook
SavePath is a string for the file path "C:\Temp"
Data is a string used to name the file, assigned dynamically in the
code. "Donations" for example.

FileExtStr is a String = ".xls" if the version is pre 2007

FileFormatNum is -4143, if the version is pre 2007


On Error GoTo PathError

DestBk.SaveAs SavePath & Year(Date) & "\" &
MonthName(Month(Date) - 1) _
& " " & Year(Date) & "\" & _
Data & "_" & Format(Now(),
"MMM_DD_YYYY") & FileExtStr, _
FileFormatNum


PathError: MkDir (SavePath & Year(Date) & _
"\" & MonthName(Month(Date) - 1) & " " &
Year(Date))
Resume

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
Error handler linto Excel Discussion (Misc queries) 1 February 11th 10 12:17 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
Error handler help Nigel Excel Programming 2 May 5th 05 11:08 AM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
Error Handler not handling error... Daniel Bonallack[_2_] Excel Programming 2 July 22nd 03 09:01 AM


All times are GMT +1. The time now is 06:25 AM.

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"