Help: Excel Freaks to the Fore!

Hi, I need some help with an Excel feature that just doesn’t want to follow the instructions I’m getting from the help program …

I’m trying to insert a macro into a workbook that would work as a button that automatically sends the workbook to an e-mail recipient as an attachment, i.e. replacing the click-series you’d have to go through to do the same action amnually by going to the FILE menu, selecting SEND TO, then MAIL RECIPIENT AS ATTACHMENT.

If I try it with a cell, it doesn’t work at all, no macro is recorded, no matter whether I select “relative to the position of the active cell” by clicking on the “RELATIVE” button on the STOP RECORDING pop-up or not.

When I try it with a little text-box (the first approach as I want it to look more like button) it seems to record something, the cursor changes to the little hand when hovering over the button, but clicking it has no effect whatsoever, nothing happens …

Any help? Thanks a lot!! Xpet.

[quote=“Xpet”]Hi, I need some help with an Excel feature that just doesn’t want to follow the instructions I’m getting from the help program …

I’m trying to insert a macro into a workbook that would work as a button that automatically sends the workbook to an e-mail recipient as an attachment, i.e. replacing the click-series you’d have to go through to do the same action amnually by going to the FILE menu, selecting SEND TO, then MAIL RECIPIENT AS ATTACHMENT.

If I try it with a cell, it doesn’t work at all, no macro is recorded, no matter whether I select “relative to the position of the active cell” by clicking on the “RELATIVE” button on the STOP RECORDING pop-up or not.

When I try it with a little text-box (the first approach as I want it to look more like button) it seems to record something, the cursor changes to the little hand when hovering over the button, but clicking it has no effect whatsoever, nothing happens …

Any help? Thanks a lot!! Xpet.[/quote]

Xpet, if you want to do it off a button then you will need to create a form in VBA for it.

If you want to run it from a keyboard command then try the following script

Sub email()

’ email Macro

’ Keyboard Shortcut: Ctrl+v

Application.Dialogs(xlDialogSendMail).Show
End Sub

If you make sure that this is saved into your Personal.xls macro file then it should be available from all open excel files.

If you want to change the keyboard shortcut from Ctrl+v then feel free, or the macro name from email, just the example i was using.

If you want something to run from the main menubar then this is also possible, however that requires a lot more coding.

Hi there, and thanks for the help! I’ve tried to do it, but couldn’t … I opened TOOL > MACROS > VISUAL BASIC EDITOR (is that what you mena by VBA? I assumed so as I couldnt find anything else that fits …)

In the editor, I inserted a “USER FORM”, right-clicked on the on the form and selected VIEW CODE. In the code view, I inserted the code you posted. I then closed the window as there are no buttons “oK” or “SAVE” or anything …

The USER FORM seems unchaged after that, and that’s also where I dpn’t know how to continue as enything I do (save, hit “close and return to ecel”) jsut takes me back to the worksheet, where there is no macro funciton to be found for the button …

What am I doing wrong?? (probably a lot :wink: )Thanks for taking the time to help me here, much appreciated! Xpet.

Traveller, you the Excel God! I tried recording a macro as I did before, then went into Code Editor and replaced the code with the one you posted, saved, and it worked, great!! Thanks a lot, if I can ever reciprocate … :slight_smile:

Just happy that it worked for you.

Who di man - you di man!! :wink:

sorry to slightly hijack this thread, but what are the best excel books for getting me up to speed on excel reasonably quickly. I want something to take me to a high intermediate level and with some practice material. My level at the moment is very basic - a couple of simple formulas and that’s about it.

Thanks.