![]() ![]() NewGenYear = 0: LastGenYear = 0: year_create_counter = 0ĭim cell_person As Range, cell_num As Rangeĭim Sheet_Archive As Worksheet, ShVal As Integer ShiftYear (what code is in) and PleaseWait are userforms, and "Troop to Task - Tracker" is the sheet I'm copying.ĭim NewGenYear As Integer, LastGenYear As Integer, year_create_counter As Integer Line (59) with error 1004: ActiveWorkbook.SaveAs fileName:=PathAndFile_Name, FileFormat:=xlOpenXMLWorkbook I want to default to the same file location as the original, and regardless I want the user to be able to save into the same file location, especially since that is a very typical thing to do. I created an "If" check to see if the selected file location from the SaveAs dialog is the same as the file location of the original and was able to create an error handler (avoid the error), but not an error solution. It returns a "Method 'SaveAs' of object '_Workbook' failed" error. xlsx) by copying the sheet > saving the copied sheet in a new workbook > doing things to the sheet within the new workbook > saving and closing new workbook then continuing the rest of my code.Įverything works as coded except when the user selects (or keeps selected) the same file location, in the SaveAs dialog, that the original file (with the running VBA) is in. ![]() ![]() I have code designed to create an archive of my main sheet (as a. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |