Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Save As' Macro Debug Error
-------------------------------------------------------------------------------- Hi Everybody, Thank you for having me on this forum. Thanks to the help of some Excel users, I was able to get some code to save an existing worksheet to a new workbook. However, when a duplication file name exists it prompts me to save as and if I click 'No' I get a debug error message. I'd still like the 'save as' message to come up but is there a way I can get eliminate the debug error message if 'No' is clicked? This is so it just works normally when saving as a different file name or clicking no when an invoice is accidentally duplicated. Please see below code: Code: -------------------- With Sheets("Invoice2") Dim invName As String Sheets("Invoice2").Select invName = Range("L4").Value & ".xls" Sheets("Invoice2").Copy ChDir "C:\Users\Justin\Documents\Razza Jam" ActiveWorkbook.SaveAs Filename:=invName ActiveWorkbook.Close End With -------------------- Any help would be greatly appreciated. Kind regards, Brown Teddy Bear -- polar ------------------------------------------------------------------------ polar's Profile: http://www.thecodecage.com/forumz/member.php?userid=564 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=119605 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Debug Error | Excel Discussion (Misc queries) | |||
When I try to save, it says debug, what does that mean? | Excel Discussion (Misc queries) | |||
How do I resolve debug error macro Excel 2000? At least, any lead | Excel Discussion (Misc queries) | |||
when i save xls file, debug script is running and canno't save fil | Excel Discussion (Misc queries) | |||
down with the debug error | Excel Programming |