how to stop opening of another excel file automatically when running macro

bhavdip_mangukiya

New Member
Joined
Jan 28, 2023
Messages
13
Office Version
  1. 2019
Platform
  1. Windows
I have copied Maco from one file to another file. All works okey, but when i run the macro it automatically open the original file from where it is copied.

how to stop it?

anyone can please help
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
There are 8 diffrent modules of macro I'm using
Its just there is a reset but which will change the colour of cells
When I hit it, it just opens up the original file from where it was copied
I have used drag and drop method to copy the sheet from one file to another
 
Upvote 0
Please post a copy of the code for your macro.
Sub SnipSameSideCornerRectangle6_Click()

Range("B6, B8, B10, B12, B14, B16, D6, D8, D10, D12, D14, D16, F6, F8, F10, F12, F14, F16, H6, H8, H10, H12, H14, H16, J6, J8, J10, J12, J14, J16").Interior.ColorIndex = 33



End Sub
 
Upvote 0
Sub SnipSameSideCornerRectangle6_Click()

Range("B6, B8, B10, B12, B14, B16, D6, D8, D10, D12, D14, D16, F6, F8, F10, F12, F14, F16, H6, H8, H10, H12, H14, H16, J6, J8, J10, J12, J14, J16").Interior.ColorIndex = 33



End Sub
This part of the code does not open any file on my end. look for anywhere in any of your macros for "Workbooks.open......." see example below. in VBA you can use the Find text

VBA Code:
Workbooks.open "C:\Users\Dell\Desktop\myFile.xlsx" ' in Quotation should be the file directory here I just put as Directory sample
 
Upvote 0
This part of the code does not open any file on my end. look for anywhere in any of your macros for "Workbooks.open......." see example below. in VBA you can use the Find text

VBA Code:
Workbooks.open "C:\Users\Dell\Desktop\myFile.xlsx" ' in Quotation should be the file directory here I just put as Directory sample
?
 
Upvote 0
In VBA press “CTRL + F” the. Search for “Workbooks.open” you can select entire project see if any results come up
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top