My reference library looks like this...
Refs VBA.jpg
My reference library looks like this...
Refs VBA.jpg
Well, can you try to copy all of your code somewhere, and save the file as a non-macro XLSX file. And then reopen Excel, and add back all the modules and the userform and copy all the VBA codes, and then save as a macro enabled XLSM file.
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Thanks Excel fox, done that but not working, But..... I have had a slight breakthrough in understanding whats going wrong. I added a button to the sheet 1 and wrote a macro to call the initial form. When I do this and run the code behind the form there is no problem and so this means the issue is happening because of the method in which I am calling the form, which is on the Workbook Open() event i.e form1.show
When i open the workbook and form pops up the code breaks as the range is not recognized in the class but when the form is called after the workbook is open there is no issue.
Ah! That's a reasonable conclusion. And that's probably because the worksheet object as well as the range objects aren't loaded, and only after the workbook open event is completely executed do those objects load. Well, you've probably nailed it there.
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
brilliant, thanks for all your help. In which case I guess i will have to 'Show' the form when the macro is manually started. we got there in the end
Bookmarks