i have a spreadsheet name stored in variable Spread1. This is the full path name that is opened in Access VBA earlier in the code. i have the foreshortened version of the spreadsheet name (i.e. "Test12-2008.xls") stored in variable Spread2.
The following code generates a "Subscript out of range" error:
where the value of Spread2 is "Exporttemplate12-2008.xls" (quotation marks included). If i omit this line of code, the spreadsheet is saved and sent out in an email and users cannot view the spreadsheet at all (in fact, i cannot even tell if previous code that set the cell values worked since i can't see it!).
The variables Spread1 and Spread2 are used because a new spreadsheet is created each month.
Can you help me?
The following code generates a "Subscript out of range" error:
Code:
xlWrkBk.Parent.Windows(Spread2).Visible = True
where the value of Spread2 is "Exporttemplate12-2008.xls" (quotation marks included). If i omit this line of code, the spreadsheet is saved and sent out in an email and users cannot view the spreadsheet at all (in fact, i cannot even tell if previous code that set the cell values worked since i can't see it!).
The variables Spread1 and Spread2 are used because a new spreadsheet is created each month.
Can you help me?