The macros I suggested don't contain any code which opens a file so it shouldn't be opening anything. Are you using the code as I wrote it or did you modify it in any way? If you modified it, please post the modified code.
I want to restrict my macro to a specific worksheet.
- VWRSue
- Thread is marked as Resolved.
-
-
-
Hi Mumps. I didn't change a thing. I copied exactly what you provided and pasted over what existed. I tried two ways: First, C&P the code, then Save As with new filename; Second, Saved my original file with new filename, then C&P the code, then saved it. I have attached the new file.
-
The workbook that I uploaded copies the data from Reports Data Collect, the Undo macro clears the report. If you run the macros they work fine without prompting to save or open any workbooks.
-
I ran the macros on the file you posted and the macros worked properly. I then saved the file with a new name, closed it and re-opened it, and it also worked properly so I'm not sure why they are not working for you. Did you try copy/pasting the code into the new file?
-
Have you copied any buttons to the new workbook that call the macros. This might cause that behavior.
-
So I figured out the issue. I have customized my ribbon with Macro buttons. Neither of you would have known that. If I use those buttons, then Excel wants to open my original file. If I just run the macro from View Macros, it works fine. I had assumed that once I C&P the code, the macro buttons would be associated with the new code. Apparently, that doesn't happen, or there is a step I must take to associate the button with the new code. Anyway, I recreated my buttons and everything works great.
Thank you both for all your help. I greatly appreciate your patience!
As an aside, I've started the VBA tutorials provided on this site...I hope it doesn't teach me just enough to be dangerous!
Thanks again!
-
Glad we could help and that it all worked out. Roy hit the nail on the head!!!
-
I was writing my response when Roy posted about the buttons....so thank you again...it's nice to know you would have gotten me there!
-
I take it you are customising the Ribbon in Excel Options. I'm not exactly sure how that works because I've never used it. I generally use the xml to do it.
Good luck with the courses, post back with specific questions and I'm sure we can help.
-
Yes, that's how I customize the ribbon. Thanks again for your help. This is a great site!
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!