G
Guest
Thanks to help from this site, I was able to modify a Workbook from another
Workbook. Now I need to modify a Template from another Workbook. The
problem I have is that when the Template is opened, it is opened as a .xls
file with the number one following the Template name. This is expected
behavior but I need to open the template, modify it as a template, and save
it again with the same template name programatically. I cannot have the Save
As dialog box poping up. I need all this to happen by clicking a button and
no further user action.
Here is the code I use that causes the Save As box to pop up:
Set wb = Application.Workbooks.Open("C:\Templates\Test.xlt")
wb.Sheets("Sheet1").Select
wb.Sheets("Sheet1").Range("A4").Offset(-1, 0).Select
Selection.Insert Shift:=xlDown
Selection.Value = "New Comment 3"
wb.Close True
Set wb = Nothing
Workbook. Now I need to modify a Template from another Workbook. The
problem I have is that when the Template is opened, it is opened as a .xls
file with the number one following the Template name. This is expected
behavior but I need to open the template, modify it as a template, and save
it again with the same template name programatically. I cannot have the Save
As dialog box poping up. I need all this to happen by clicking a button and
no further user action.
Here is the code I use that causes the Save As box to pop up:
Set wb = Application.Workbooks.Open("C:\Templates\Test.xlt")
wb.Sheets("Sheet1").Select
wb.Sheets("Sheet1").Range("A4").Offset(-1, 0).Select
Selection.Insert Shift:=xlDown
Selection.Value = "New Comment 3"
wb.Close True
Set wb = Nothing