SV650.org - SV650 & Gladius 650 Forum



Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).
There's also a "U" rating so please respect this. Newbies can also say "hello" here too.

Reply
 
Thread Tools
Old 18-03-11, 12:27 PM   #1
Rai86
Guest
 
Posts: n/a
Default Excel Visual Basic Code...

Anyone any good at it?


  Reply With Quote
Old 18-03-11, 12:35 PM   #2
Davadvice
Guest
 
Posts: n/a
Default Re: Excel Visual Basic Code...

ye, what are you looking to find out?

a good place is VBFORUMS.com

drop up your code and i will see what i can do

Dav
  Reply With Quote
Old 18-03-11, 12:43 PM   #3
Rai86
Guest
 
Posts: n/a
Default Re: Excel Visual Basic Code...

I am trying to get it to send an email to a specific email address with the speadsheet attached

I can get it to bring up and email with it attached, but i have never done this before and thats about as far as i can get without any notes or help

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 18/03/2011 by Rachel Morris
'
'
Range("P30").Select
Application.Dialogs(xlDialogSendMail).Show
End Sub

I added in:

' Create a new email object

email.Subject = "Text"
email.Body = "Text"
email.From = "USER <EMAILADDRESS>"
email.AddTo "ADMIN","EMAIL ADDRESS"


But doesnt like that. And its all a bit futher than my basic knowledge goes
  Reply With Quote
Old 18-03-11, 12:57 PM   #4
custard
Guest
 
Posts: n/a
Default Re: Excel Visual Basic Code...

beyond me.. i tend to record the macro and then chop it about to suit...
  Reply With Quote
Old 18-03-11, 01:45 PM   #5
Davadvice
Guest
 
Posts: n/a
Default Re: Excel Visual Basic Code...

Quote:
Originally Posted by Rai86 View Post
I am trying to get it to send an email to a specific email address with the speadsheet attached

I can get it to bring up and email with it attached, but i have never done this before and thats about as far as i can get without any notes or help

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 18/03/2011 by Rachel Morris
'
'
Range("P30").Select
Application.Dialogs(xlDialogSendMail).Show
End Sub

I added in:

' Create a new email object

email.Subject = "Text"
email.Body = "Text"
email.From = "USER <EMAILADDRESS>"
email.AddTo "ADMIN","EMAIL ADDRESS"


But doesnt like that. And its all a bit futher than my basic knowledge goes

change the File extention of the attachment from DOC to XLS (not able to upload xls files) if you open the file then navigate to VB you will see 2 modules ones a BAS file and the other is a CLS file.

the line OL.SendMessage "EMAIL@EMAIL.com", "TEST", "TEST123"

if you add a file name to the end like this
OL.SendMessage "EMAIL@EMAIL.com", "TEST", "TEST123", "c:\TESt.txt"

then it will send the attachment as well.

if you want to know how it works in detail give me a shout and i will do my best.

cheers
Dav
SEND_MAIL.DOC

Last edited by Davadvice; 18-03-11 at 01:50 PM.
  Reply With Quote
Old 18-03-11, 02:04 PM   #6
Rai86
Guest
 
Posts: n/a
Default Re: Excel Visual Basic Code...

Brilliant thank you, i will give it a go
  Reply With Quote
Old 18-03-11, 02:44 PM   #7
mikerj
Member
 
Join Date: Jul 2010
Location: Devon
Posts: 876
Default Re: Excel Visual Basic Code...

Have a look here
mikerj is offline   Reply With Quote
Old 18-03-11, 04:17 PM   #8
DarrenSV650S
Member
Mega Poster
 
DarrenSV650S's Avatar
 
Join Date: Jul 2006
Location: Dundee
Posts: 4,414
Default Re: Excel Visual Basic Code...

DarrenSV650S is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Audio / Visual Thread......... hindle8907 Idle Banter 174 18-10-12 09:14 PM
Some basic HELP with EXCEL pls 600+ Idle Banter 4 02-10-07 01:59 PM
Visual Basic help req'd Supervox Idle Banter 6 22-06-07 10:56 AM
anyone knows a good book about Visual basic? Dave The Rave Idle Banter 5 01-05-07 05:20 PM
Visual Studio 2005 Settings MavUK Idle Banter 6 24-10-06 02:54 PM


All times are GMT. The time now is 05:08 AM.


Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.