Security Prompt Even After Deleting Macros Using VBA Code

Jun 27, 2007

I have used the following Macro that deletes the Macro code. It then saves the file and quits excel.

*************************************
Sub removeAllCode()
Dim awi
Dim awcl As Integer
Dim count As Integer
Dim i As Integer 'loop counter
On Error Resume Next
count = ActiveWorkbook.VBProject.VBComponents.count
For i = 1 To count
Set awi = ActiveWorkbook.VBProject.VBComponents.Item(i)
awcl = awi.CodeModule.CountOfLines
awi.CodeModule.DeleteLines 1, awcl
Next i
Set awi = Nothing
ThisWorkbook.Save
Application.Quit
End Sub
*************************************

However when I open the Excel File, I still get the Macro Prompt. I have checked in Macro list as well as in VB Editor and no Macro code exists

If I have the file manually (or do a save as) and then reopen the file, I no longer get the Macro prompt.

I have tried various examples listed in different forums/sites but nothing works.

View 9 Replies


ADVERTISEMENT

If Macros Are Diabled At Security Prompt, How To Prevent Workbook From Opening

Dec 15, 2008

I am relying on macros for a lot of functionality and security.

Is there a way to stop a spreadsheet from being opened/accessed if a user disables macros at the security prompt?

View 9 Replies View Related

Code To Bypass Outlook's Security Prompt

Sep 11, 2005

when sending an email in code from Excel through Outlook, the following Microsoft Office Outlook dialog appears during code execution in Office releases since 2002:

A Program is trying to automatically send e-mail on your behalf.
Do you want to allow this?
If this is unexpected, it may be a virus and you should choose "No".

Two buttons: [Yes] [No]

Question

Has anyone used or developed code that bypasses this prompt, and if so, would you please post an example of your code here. What I would like is a macro in VBA and / or API that you know from your own first-hand experience has worked for you, that emails an Excel attachment from Excel, using Outlook (not Outlook Express) as the email client, which bypasses the above prompt.....................

View 9 Replies View Related

Excel 2007 :: Security Notice Prompt

Apr 15, 2013

I am using excel 2007 to open files with macros embedded. Most of the time, I would receive the security notice in the ribbon but sometimes the notice would appear as a prompt as with excel 2003.

How can I set it up so I would always have the prompt instead of the message in the ribbon. The reason is that with the one in the ribbon, new users to 2007 often fail to activate the macro for the the file to work properly. With the prompt, users have to either enable or disable the macro to view the file.

View 3 Replies View Related

Security Warning (Macros Have Been Disabled)

Apr 28, 2008

I was playing around with Macros on an excel file. I created a few and ran them. In the end, I didn't like the way they ran, so I deleted them all. However since I ran them in the excel file, every time I open the file it gives me a warning saying
"Macros have been disabled."

Is there any way to remove the possible Macros ties/links from my file? I know I can disable the warning, but if I just want to remove the Macros ties to my file.

View 10 Replies View Related

Turn Off Security Warning Regarding Macros

Jun 2, 2009

I would like the security warning not to pop up when the workbook is opened. I have been able to turn it off for myself but I had someone else test it and each time it's opened the security warning pops up with the disable, enable messages. Is there a way to turn this off permanently so not matter who opens it it won't pop up?

View 9 Replies View Related

Macros Dont Work Even On Low Security

Aug 21, 2009

My dad wrote me a VB programme to save me time entering repetitive data into an excel template for my business. At first it didnt work untilll i reduced security to low. Sice then I fried my computer and have had to reformat it with a diffirent version of windows, vista service pack 3. Now even on low security it doesnt work.

The little button in the worksheet to make the macro happen isnt visible or doesnt exist.

View 13 Replies View Related

Without Prompting For Any Macros Security Message

Aug 28, 2008

i want my application which i build though VBA in excel run on every computer without prompting for any Macros security message so is there any solution?

View 9 Replies View Related

Security Alert This File Contains Encrypted Macros...

Mar 3, 2007

I just loaded Excel 2007, and then opened a workbook I wrote that made pretty extensive use of macros and code. I knew enough to first set up Excel via the "Trust Center" to allow ALL macros to run, against MS's, or more likely against MS's lawyer's, recommendations. btw, does anyone have a clue as to what "Trust access to the VBA project module" is all about? Apparently MS doesn't, for I have searched Help and the KB for it in vain. Anyway, I brought the old xls workbook in, then saved it as a macro-enabled spreadsheet, .xlsm. Then I open it, and uhg, a most distasteful surprise. Even though I specifically went in and set Excel to run all freaking macros, someone at MS has decided I am too stoooopid to make this decision, and all macros have been automatically disabled. OK, so let us click where it says "Options" on this warning bar.

A window pops up telling me that this file contains encrypted macros that have been disabled...". Do a search on that, again, MS, MS kb, even Google, and you are not going to find it (In quotes). There is ONE freaking option with a radio button now, telling me "Help protect me from unknown content" - again, I try a Google search, an MS search and an MS kb search... nothing directly addressing it; but I do the logical intuitive thing - there is a selected radio button there, so click it to unselect it. Click the idiot thing until the cows come home, darn it, it won't do a thing! I even tried an Alt-p as they have the "p" underlined - all that does is select the statement, it remains selected, tap the space bar, hit the space bar, stand on the space bar... First they disable all the macros. OK, I can live with going in and fixing that, but then deciding that I am too dumb to make that choice so don't allow me to turn them on in my own freaking code? Yes, it has been several hours and I am still pissed off beyond belief.

View 9 Replies View Related

Security Warning About Macros When Opening 2003 File

Mar 3, 2009

I'm using Excel 2003 and recently when I open a file, it prompts out a Security Warning message about Marcros which at the end contains 3 choices: Disable Macros, Enable Macros, and More Info. I then click Enable Macros to open the file. Once open, I go to Tools > Marco > Run Marco (Alt+F8). A Macro box prompt out but the Macro list is empty. I try different choice inside the pull down menu "Macros in" but the Macro list is still empty.

Where can I find out the macro which triggers the warning message of Security Warning when opening the file? And how can I delete the macro if found useless.

View 7 Replies View Related

Prompt Users To Activate Macros

Mar 27, 2008

I update an Excel file daily and save it to a server on a network. Other network users access this file from their own computers. I have a macro created that opens a dialog box upon opening that shows users know of anything important.

Since employees in the office have Excel set to Paranoid mode or something like that, they are never even prompted that macros exist and are intended to run and that they should choose to allow them to run or not.

I would like to approach the problem in a way other than asking all employees to activate all macros or to lower their Excel security settings at all times or only when opening this single document. That would be considered too inconvenient.

View 8 Replies View Related

Deleting Cells Won't Prompt To Shift Row Or Column Up / Down - Left Or Right

Feb 22, 2013

I've attached the sheet I'm working with. I need to delete most of column F and shift the rows to the left, but when I delete the cells it doesn't give me a prompt to shift the row, it just deletes the entire column or individual row. I need them to shift, what can I do?

Attached File : Coordinators Test.xlsx

View 3 Replies View Related

Macro - How To Remove Delete Prompt When Deleting A Sheet

Jul 22, 2013

I have a Macro which deletes a sheet called "Pre selection" with:

Sheets("Pre selection").Select
ActiveWindow.SelectedSheets.Delete

It asks me every time if I am sure and I have to click to continue. Is there any way to remove this prompt or set it to continue without my intervention?

View 3 Replies View Related

Avoid Delete Prompt Deleting Sheets/Worksheets

Aug 9, 2006

whenever you want to delete a sheet, excel would prompt you to ask you if you are sure you want to delete the sheet. im making a vba so that the sheets will delete upon workbook close, but i dont want to be prompted everytime to be sure to delete it when running the vba macro. Also, i would like to avoid being asked to save any changes to my workbook

View 2 Replies View Related

Security Code Input

Dec 7, 2009

If I have a cell which has been validated and has a drop down list of 4 names in it.
I need it to prompt the user that when they choose there name and select, a window pop up or similar window appears asking for a 4 digit(or similar) code.

This is to stop others using peoples names against jobs they have completed so there is accountability if there are issues with information.

For each line I need it to re-prompt the user to enter the 4 digit pin so it cannot be tampered with.

Can anyone help with sending through a form and VB code possibly which I can copy into my spread sheet or a method I can use!

View 14 Replies View Related

Code To Edit Macro Security Settings

Apr 1, 2008

I need a code to change the Macro security settings of the computer where the file is opened to enable macros.

View 9 Replies View Related

Display Macro Security Level Code

Sep 6, 2006

Although not a complete novice, I am fairly new to EXCEL/VBA.
Is there a script that can be embedded into an EXCEL workbook that checks the Macro security of the PC, and if set to HIGH, shows a message that states that "Macro security is too high to open this workbook".
With security set to high, Excel will open my w/ book, but not run any of my checks that are set in the module. So a "catch 22" really, I need the macros to run to that it is being opened on an authorised computer etc, but if security is set to HIGH, then they don't run, similarly, if I put a macro in to check the macro setting, it won't run unless the security is set to medium.

View 9 Replies View Related

Deleting Rogue Macros

Mar 10, 2008

I have inherited a few workbooks for some monthly reports, and there appear to be several macros in the book that are not used anymore. I noticed them when I tried to run one of my own macros using Tools-->Macros--> Run Macros. While they are listed in the run macros list, I can not select "Delete" and there are no modules in the VBA editor besides those I inserted myself. If I try to run one of them I get the error "Reference is not valid."

View 9 Replies View Related

Row Coloring And Column Deleting Macros

Oct 4, 2009

I'm making excel macros for the first time and getting things figured
out, but I have a few questions:

What code do I use to delete columns that have all empty cells EXCEPT
the top cell (row 1) that contains any of a number of headings? I need
to insert this into an existing macro.


What code do I use to fill color every other row (preferably even numbered)
light grey after selecting a "currentregion" ? Again, to put inside an
existing macro.


A related question: When I find code help on the web, it usually
starts with "sub" and ends with "end sub" so how do I insert that into
an existing macro? It looks like a "sub within a sub" doesn't work.

View 9 Replies View Related

Add In A Text Box Prompt That Will Modify Code

Apr 29, 2009

how to add in a text box prompt that will modify code?

View 4 Replies View Related

Password Prompt - VBA Code Advice

May 11, 2006

I have created a workbook that mostly works with VBA codes. Within the code I have ensured that certain worksheets remain hidden. However, I have also written a macro to access what I called the ADMIN worksheet, which has several commands enabling updates and troubleshooting. Long story short, I would ideally like to prevent users from accessing that worksheet. I have already created a prompt (Msgbox) asking the user if he/she wishes to proceed with the macro but I would prefer being able to have a password prompt to run the macro.

View 4 Replies View Related

Msgbox That Will Prompt For Answer Before Running Code

Apr 28, 2009

I need a MsgBox that will prompt for a Yes or No response. If you answer Yes run the code below if you answer no just stop and leave me in the current sheet.

View 10 Replies View Related

Keep Code Running When Message Prompt Shows

Mar 1, 2008

I have code to open another workbook and run a specific macro. I plan to then take that and copy it over to my workbook.

The problem I am encountering is when I run this macro, at the end of the code, a form/msg pops up stating it is complete. This then automatically stops my code from running (from my original workbook). How do I close this form in order to keep my code running?

View 3 Replies View Related

CMD Prompt Code And Display Result (Hostname Or IPConfig)

May 31, 2014

Is there a way to use cmd prompt via vba?

I would like to run "HOSTNAME" and have that displayed as msgbox text.

I am hoping its fairly simple and diverse so I can just change the cmd code to suit.

E.g.

Code:
private sub gethost()
dim host as long
host = (CMDRUN) "HOSTNAME"
msgbox "your host name is " & host

There must be a way so would like to see but I am struggling to get results on search engines.

View 1 Replies View Related

Messagebox Prompt Then Allow User To Enter Data Before Continuing Code Execution

Jun 11, 2013

Basically, in the "Thisworkbook" code , i have some code in the Workbook_BeforeClose section. Currently , it autosaves the workbook in a folder i have specified.

However, i need to add some code.I want to check that a certain cell has a value in it before the user closes the workbook, and if the cell is empty, show a messagebox asking him to enter a value.

I know how to get a messagebox to pop up, the only thing is once the user clicks the OK button,
i need the rest of the code execution to pause, allowing him to make the change then if he clicks the "X" (top right of the screen) to close the file or application, the filesave dialog appears and he can then save the document.

how to go about this because at the moment when user clicks ok, the messagebox just disappears and filesave dialog appears and he doesn't have a chance to edit the cell.

View 5 Replies View Related

VBA If Range Value = Something AND Another Cell Has No Entry- Prompt The User To Enter Data- My Code Is Not Working

Apr 20, 2009

I am trying to display a message box for the user if there is "agency" in cell o8 but nothing in p8... I tried the following code but it doesnt work..


If Range("o8").Value = "Agency" And Range("p8").Value = "" Then

MsgBox "Please provide name of agency in cell p8"

Sheet9.Shapes("cross").Visible = True

Else

View 9 Replies View Related

Macro To Delete Vba Code - Macro Security Warning

Feb 7, 2008

I have recently grabbed the very helpful "Macro to delete VBA code" from this site, and it's working but with one small problem.

My worksheet runs a lot of code, then deletes all macro code and saves itself.

The problem is the next time i open I still get the macro security warning!

I've checked thoroughly and there is definatley no vba left anywhere.

If I open the document, enable macros, and save it, then open it again, I no longer get the warning.

View 9 Replies View Related

Macro Security (saying That The Macro Security Level Is Too High)

Nov 18, 2008

I have a sheet that will not let me use macros. I can record them, but when I go to use them it says that the Macro security level is too high. I change it to Medium or Low but it doesn't make a difference.

The same spreadsheet works with Macros on another computer, but not my main one.

View 5 Replies View Related

Deleting Event Code With Code

Sep 2, 2006

Is is possible to use VBA to remove/delete a macro and also remove code like this on worksheets:

Private Sub Worksheet_Change
End Sub

Private Sub Worksheet_Activate()
End Sub

View 4 Replies View Related

Deleting While Looping VBA Code

Aug 15, 2012

I have a worksheet and the products starts from the first row has product name and 2 following rows are other information which i do not need. i was trying to figure out a VBA code that can leave the first rwo and delete every 2 rows below the first one and then to complete this until the end of the data.

For example: in the following rows, i want to keep rows 1, 4, 7 and all others to be deleted and this process to continue until the last rows having data.

Column A
1 Product name
2 serial number
3 manufucture date
4 Product name
5 Serial number
6 manufucture date
7 Product name
8 serial number
9 manufucture date

Sub Deletesecondtworows()
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved