I have a spreadsheet that I have opened using the following code:
ximpMY = txtimpmy.Value
WorkbookImpromp = "c:/Deferred Revenue_" & ximpMY & ".xls"
Workbooks.Open Filename:=WorkbookImpromp
I would now like to activate it. I have tried using the following code:
Workbooks(workbookimpromp).Activate
When I try to use this code I get the following runtime error:
"Subcript out of range"
The only way I can get this to work is if I replace the variable workbookimpromp with "Deferred Revenue_" & ximpMY & ".xls"
Can anybody help me with this? I really would like to use the variable.
thanks
ximpMY = txtimpmy.Value
WorkbookImpromp = "c:/Deferred Revenue_" & ximpMY & ".xls"
Workbooks.Open Filename:=WorkbookImpromp
I would now like to activate it. I have tried using the following code:
Workbooks(workbookimpromp).Activate
When I try to use this code I get the following runtime error:
"Subcript out of range"
The only way I can get this to work is if I replace the variable workbookimpromp with "Deferred Revenue_" & ximpMY & ".xls"
Can anybody help me with this? I really would like to use the variable.
thanks