• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA opens file but does not activate it.

patsfan

Member
I've been running a macro daily for over 5 years that would automatically activate each workbook after opening. Beginning this morning, when VBA opens a file, it does not automatically activate it.
Code:
Workbooks.Open Filename:="\\jupiter\projects\macrofile.xls"

I've tried this on three different machines and even pulled up backup versions of the macro and in each case the newly opened file is not automatically activated. With witnesses that also know something about VBA.

Funny thing is this does not happen with every macro. Some macros work correctly and files are activated upon opening and some are not. Each macro is written in .xls format.

Not sure if I'm finally losing it or if something change that would have impacted multiple machines?

Thoughts?

Thoughts?
yep should have posted in the VBA section

POST MOVED BY MODERATOR

.
 
Last edited by a moderator:
Hi,

Never saw that happen, but you could just add a line to the code like:

Workbooks("Name.xls").Activate

and you should be good to go.
Still, I will hang around this thread to see if someone has any clue, just curious :)

Regards
 
Thanks for responding PCosta... that is what I ended up doing. And thanks Moderator for moving to the VBA section... now I know it exists. LOL.
 
Back
Top