ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro warning (upon opening) (https://www.excelbanter.com/excel-discussion-misc-queries/13746-macro-warning-upon-opening.html)

Richard

Macro warning (upon opening)
 
How do you get rid to the macro warning? I have deleted all macros in the
file and saved changes. When I reopen the file, the message still pops up.
When I go to the macro section, there are no macros to select. There are not
any in my personal workbook, or current open workbook.

Is this an issue of, once a macro is attached the warning message is
permanent?

Separate question:
Where is the code to execute the macro with a shortcut? I see the option
when creating, but have not found any code to carry out the command.


Otto Moehrbach

Richard
You have workbook modules, sheet modules, and regular modules, all of
which can have macros or be blank. You say that there are no macros. Have
you looked at all the sheet modules and at the workbook module? If you have
and you have deleted all the macros from those modules, then those modules
will not trigger that warning. However, an empty regular module will
trigger that warning. You have to delete those modules.
Do this. With the file on the screen, do Alt-F11. This will take you
to the VBE, Visual Basic Editor. Make sure you have the Project Explorer
window showing on the left side of the Editor screen. If you don't, click
on View - Project Explorer. In the Project Explorer find your file name.
Expand your file listing until you see the modules listed under the heading
"Modules". Select each module and click on File - Remove module modulename.
Click No when asked if you want to export that module before deleting. Do
this until you no longer have any modules listed. Done. Save the file.
HTH Otto
"Richard" wrote in message
...
How do you get rid to the macro warning? I have deleted all macros in the
file and saved changes. When I reopen the file, the message still pops
up.
When I go to the macro section, there are no macros to select. There are
not
any in my personal workbook, or current open workbook.

Is this an issue of, once a macro is attached the warning message is
permanent?

Separate question:
Where is the code to execute the macro with a shortcut? I see the option
when creating, but have not found any code to carry out the command.




Dave Peterson

Debra Dalgleish has some instructions with pictures at:
http://www.contextures.com/xlfaqMac.html#NoMacros

I don't understand the second question.

If you hit the shortcut key, it runs the macro.

And you can go back later to assign the macro.
Tools|macro|macros|select your macro
Options button



Richard wrote:

How do you get rid to the macro warning? I have deleted all macros in the
file and saved changes. When I reopen the file, the message still pops up.
When I go to the macro section, there are no macros to select. There are not
any in my personal workbook, or current open workbook.

Is this an issue of, once a macro is attached the warning message is
permanent?

Separate question:
Where is the code to execute the macro with a shortcut? I see the option
when creating, but have not found any code to carry out the command.


--

Dave Peterson

Richard

The second question is: Where is the code that executes the macro with the
shortcut? I believe that it is embedded in the modules (something like
uponexecute?). Is this correct?

Thanks for the tip on the options selection. I never noticed it before.

"Dave Peterson" wrote:

Debra Dalgleish has some instructions with pictures at:
http://www.contextures.com/xlfaqMac.html#NoMacros

I don't understand the second question.

If you hit the shortcut key, it runs the macro.

And you can go back later to assign the macro.
Tools|macro|macros|select your macro
Options button



Richard wrote:

How do you get rid to the macro warning? I have deleted all macros in the
file and saved changes. When I reopen the file, the message still pops up.
When I go to the macro section, there are no macros to select. There are not
any in my personal workbook, or current open workbook.

Is this an issue of, once a macro is attached the warning message is
permanent?

Separate question:
Where is the code to execute the macro with a shortcut? I see the option
when creating, but have not found any code to carry out the command.


--

Dave Peterson


Dave Peterson

If you assign a shortcut key to a subroutine, you can see that shortcut key
assignment if you export that module.

I did this in module1.
Option Explicit
Sub testme()
MsgBox "hello"
End Sub

I exported it (right click on it in the project explorer)
And saw this in my favorite text editor:

Attribute VB_Name = "Module1"
Option Explicit
Sub testme()
MsgBox "hello"
End Sub


Now I went and assigned a shortcut key to that procedure (and added a
Description -- in that same dialog) and re-exported:

Now I see this:
Attribute VB_Name = "Module1"
Option Explicit
Sub testme()
Attribute testme.VB_Description = "my favorite function"
Attribute testme.VB_ProcData.VB_Invoke_Func = "K\n14"
MsgBox "hello"
End Sub

===
So this is something you can see when you export it, but it's not viewable (by
me anyway) in the VBE.

I closed the workbook and started another. I imported that code and the ctrl-K
shortcut key worked nicely for that workbook.

========

Are you looking to find the list of shortcut keys or are you trying to assign a
shortcut key in your code.

If you're looking for the latter, take a look at VBE's help for:

Application.macrooptions

(there's some shortcutkey stuff in there.)

If you're looking for a list, a little bit ago, someone (who???) wrote a
procedure to dump the modules and open them looking for that key value. You
could search google for, aw, heck.

Take a look at this thread:
http://google.co.uk/groups?threadm=7...ing.google.com
(one line in your browser)

Especially Ivan Moala's post.






Richard wrote:

The second question is: Where is the code that executes the macro with the
shortcut? I believe that it is embedded in the modules (something like
uponexecute?). Is this correct?

Thanks for the tip on the options selection. I never noticed it before.

"Dave Peterson" wrote:

Debra Dalgleish has some instructions with pictures at:
http://www.contextures.com/xlfaqMac.html#NoMacros

I don't understand the second question.

If you hit the shortcut key, it runs the macro.

And you can go back later to assign the macro.
Tools|macro|macros|select your macro
Options button



Richard wrote:

How do you get rid to the macro warning? I have deleted all macros in the
file and saved changes. When I reopen the file, the message still pops up.
When I go to the macro section, there are no macros to select. There are not
any in my personal workbook, or current open workbook.

Is this an issue of, once a macro is attached the warning message is
permanent?

Separate question:
Where is the code to execute the macro with a shortcut? I see the option
when creating, but have not found any code to carry out the command.


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com