PDA

View Full Version : Solved: Subscript out of range when using name of workbook that exists



zagrijs
04-24-2013, 04:03 AM
Hi

I'm writing code to create a report in a second workbook based on data located in first workbook.

A little form opens with a combobox to enter the name of the new workbook (report) and the value of the combobox is used to name the new workbook.

So far so good. The new workbook is created and renamed as instructed.

But when I use the combobox value in following code to refer to the second workbook I get the error message "Subscript out of range".

I don't know why.

Can anyone help me, pls.

Zagrijs

mdmackillop
04-24-2013, 03:31 PM
We would need to see your code.
Possible issues:
Are you referring to an open or closed workbook?
Is the suffix ".xlsx" or whatever being appended?

zagrijs
04-24-2013, 11:13 PM
The suffix was missing. I realised that and marked my thread "solved" before you responded. Should have explained how I solved it.

Thanks for your response