I am trying to set a Workbook variable with the following
I keep getting 'subscript out of range' errors on this
I know that the string variable is good because I have tested it by having the code paste it into a range. I have also tried pasting the string and then using the range value but nothing works. Can anyone tell me what I am doing wrong?
Thanks
Code:
Public sendBook as Workbook
Public bookName as String
Set sendBook = Workbooks(bookName & ".xls")
End Sub
I know that the string variable is good because I have tested it by having the code paste it into a range. I have also tried pasting the string and then using the range value but nothing works. Can anyone tell me what I am doing wrong?
Thanks