Save As function for data exported to excel
After user input in my software i have a feature which exports all data to an existing excel file in which i have already formatted and given the report headings and everything which does not change. i dont want to give the user the burden to save it, it shud be saved automatically. that part is actually done, but the problem is the intellicent is not giving me an option to save it in a different path. it is over writing the template file. How do i go about doing this??
Code:
MyExcel.ActiveWorkbook.SaveAs(P1Scorer.Name + " VS " + P2Scorer.Name + ".xlsx")
Its telling me to enter the filename and extention after which it asks for the fileformat which i want to be default and then its asking for password and other kind of stuff but how do i set the save as path?? so that it doesn overwrite my template.
Re: Save As function for data exported to excel
Um ... by not using P1Scorer.Name + " VS " + P2Scorer.Name + ".xlsx" as the filename? I really don't understand what the problem is here. You can save the file as many times and using as many different names as you want at any stage while the workbook is active/open.