VBA code already there in brand new file

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,752
Office Version
  1. 365
Platform
  1. Windows
Hi
I closed all excel files. I opened a new one by clicking on excel icon. I go to VBA editor and I see some codes there? Why and from where they came? Thank you very much.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,446
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Perhaps you have add-ins and/or a Personal.xlsb workbook that contains macros.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,213
Office Version
  1. 365
Platform
  1. Windows

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,819
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
Or may be it's just Option Explicit code line there.
If so then you can ignore that as it does not saved with XLSX, such a behavior can be disabled in VBE - Tools - Options - Editor - Require Variable Declaration, but it is useful for coding.
 

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,239
Office Version
  1. 365
Platform
  1. Windows
Or when you open the VBE, is the Funcres file showing codes.
 

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,752
Office Version
  1. 365
Platform
  1. Windows
Thank you all. I appreciate the help

Or when you open the VBE, is the Funcres file showing codes.

Or when you open the VBE, is the Funcres file showing codes.
Or may be it's just Option Explicit code line there.
If so then you can ignore that as it does not saved with XLSX, such a behavior can be disabled in VBE - Tools - Options - Editor - Require Variable Declaration, but it is useful for coding.
Is the code actually in the workbook that is automatically opened when you open Excel, or as JoeMo has suggested?

If the code is in the standard workbook that is opened with Excel, then perhaps you have a workbook with VBA code in your Excel 'Startup folder'. See Customize how Excel starts
 

Watch MrExcel Video

Forum statistics

Threads
1,133,463
Messages
5,658,918
Members
418,476
Latest member
Tristram_ZX81

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
Top