Hi JapanDave,
Thank you for troubleshooting and what a great idea.
I wonder, however, if this solution will pose another potential problem:
The only reason I'm having my original workbook call THIS one to open is to get data from THIS workbook for the purpose of reporting data that has been collected in BOTH workbooks.
When we don't do reports yet but are just collecting data, when user tries to open THIS workbook, it then try to have the original workbook open according to your code and this won't be desirable. (we have users users collect data in two different workbooks but report in together).
So, in a sense, what I'm trying to do then is......if the sub workbook is being called by another workbook, then use your code to have it open. If the sub workbook is opened directly without being called open by the main workbook, go through the original password code line...
I wonder if I should just go with the original code you previously helped me with(just be content with the way it was)
Any other ideas?
Thank you
It is hard to know how a set of workbooks will be used, but if you are always using them at the same time then another solution is in order. I always go to the easiest way to over come a problem first. I will have another look at the code.
If you are happy with the answer, please click the Star icon in the below left hand corner.
Good sites to start learning.
snb's VBA Help Files
Jerry Beaucaires Excel Assistant
J & R Excel Consultancy Services
How to post code correctly: Correct Code Posting
This code is working for me.
Private Sub CalculateTotalClinicVolume_Click() Application.EnableEvents = False 'This disables all events for all books, so no macro should run while this is false Set wbPath = Workbooks.Open("C:\Users\Owner\Desktop\JapanDaveSub.xlsm", Password:="test") 'your code here 'closing SPH workbook wbPath.Close savechanges:=False Application.EnableEvents = True End Sub
If you are happy with the answer, please click the Star icon in the below left hand corner.
Good sites to start learning.
snb's VBA Help Files
Jerry Beaucaires Excel Assistant
J & R Excel Consultancy Services
How to post code correctly: Correct Code Posting
Great you have sorted it out.
But, I should say I already made this suggestion in post #11.
If you are happy with the answer, please click the Star icon in the below left hand corner.
Good sites to start learning.
snb's VBA Help Files
Jerry Beaucaires Excel Assistant
J & R Excel Consultancy Services
How to post code correctly: Correct Code Posting
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks