Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The order of your commands is wrong. Rather than
res = InputBox("The MAXIMUM No. of Records is reached, NAME NEW File AS ? ", _ "Company Name...") ThisWorkbook.SaveAs res If res = "" Then Exit Sub you need res = InputBox("The MAXIMUM No. of Records is reached, NAME NEW File AS ? ", _ "Company Name...") If res = "" Then Exit Sub ThisWorkbook.SaveAs res -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Corey" wrote in message ... Thanks for the reply Leith. My post above your post explains what i am after a bit further. I have just realised also that, IF i click the CANCEL in the Input box, i get an error AND the NEW WorkBook is STILL created. res = InputBox("The MAXIMUM No. of Records is reached, NAME NEW File AS ? ", "Company Name...") ThisWorkbook.SaveAs res If res = "" Then Exit Sub <============= Does this not stop the macro if CANCEL or nothing is entered ? Application.Dialogs(xlDialogSaveAs).Show <============= Want this to SAVE NEW FILE NOT old file.... ActiveWindow.DisplayWorkbookTabs = True With ActiveWindow .DisplayHorizontalScrollBar = True .DisplayVerticalScrollBar = False End With End Sub Corey..... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number Format on Excel File saved from .html file | Excel Discussion (Misc queries) | |||
Saved *.csv file gives SYLK file type warning upon Excel 2003 open | Excel Discussion (Misc queries) | |||
How to tell number of spaces between values in saved text file fromthe original xls file | Excel Discussion (Misc queries) | |||
Determine if XL file opened from Outlook or a saved file | Excel Programming | |||
To get client data from a saved file back to the master file | Excel Discussion (Misc queries) |