How I can add the name to the Excel file, not to Workbook? I need to open the Excel file (without saving), and replace the title ‘Book1…Book2 with the timestamp
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True 'set to visible, this can be moved to the end if you wish
datetimestamp = Format(Now,"yyyymmddhhnn") ' creates a datetime stamp for the temp file
xlsFileName=datetimestamp+"_Incident.xls"
Set oworkbook = xlApp.Workbooks
oworkbook.Add
Subject: I believe you need to save it. Excel won’t change the name until you save the file.
Look for Excel VBA SaveAs method.
Although Excels ActiveWorkbook.windows does have a caption option which allows you to change what it appears as without saving, maybe that is what you want.
Subject: RE: I believe you need to save it. Excel won’t change the name until you save the file.
Could you share an example of ActiveWorkbook.Windows that could assign a title to the Excel file without saving?
Thanks!!!
Subject: RE: I believe you need to save it. Excel won’t change the name until you save the file.
http://www.lmgtfy.com/?q=ActiveWorkbook.Windows+caption