I have a vba code. but when i run it from the vb editor and I have another excel opened and it is active, the VBA code runs on the second excel. How can i prevent this.