Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 27th, 2004, 12:22 PM
Registered User
 
Join Date: Dec 2004
Location: Muskego, WI, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Macro Doesn't Run?

I have written a macro, but it only runs on machines that have VB6 installed on them. Is there a .dll in VB6 that is not available with Excel '97 vba

Reply With Quote
  #2 (permalink)  
Old December 29th, 2004, 09:08 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shattered Send a message via Yahoo to shattered
Default

there are a number - presumably you have added a reference to the dll through vba? You might want to check your references to see whats loaded, or reproduce the macro here so that the guilty part of the code can be isolated for you.

Reply With Quote
  #3 (permalink)  
Old January 4th, 2005, 06:18 PM
Registered User
 
Join Date: Dec 2004
Location: Muskego, WI, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

shattered,

Hope you're still interested here's the code

Code:
Private Sub CommandButton1_Click()
ActiveWorkbook.SaveAs FileName:=Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & "-" & Cells(5, 8)
emailRequest
ActiveWorkbook.Close
End Sub

Private Sub CommandButton2_Click()
emailComplete
End Sub


Private Sub CommandButton3_Click()
emailBackOrder
End Sub

Private Sub CommandButton4_Click()
emailOrdered
End Sub

Private Sub Image1_Click()
Static flag1 As Boolean
If Not flag1 Then
    Image1.Picture = LoadPicture("I:\ME\PKGroup\CHECK_MaRK.bmp") 'NOSmile
    flag1 = True
Else
    Image1.Picture = LoadPicture("")
    flag1 = False
End If
Sheets.Select
End Sub

Sub emailRequest()
    Dim RecipArray As Variant
    Dim SubjArray As Variant
    RecipArray = Array(ActiveSheet.ComboBox2.Text, ActiveSheet.ComboBox3.Text)
    SubjArray = "Items To Order: " & Cells(5, 8)
    If Application.MailSystem <> xlNoMailSystem Then
        ActiveWorkbook.SendMail _
            Recipients:=RecipArray, _
            Subject:=SubjArray, _
            returnReceipt:=True
        Application.MailLogoff
    Else
        MsgBox "No mail system installed."
    End If

End Sub
Sub emailOrdered()
    Dim RecipArray As Variant
    Dim SubjArray As Variant
    RecipArray = Array(ActiveSheet.ComboBox3.Text, ActiveSheet.ComboBox4.Text)
    SubjArray = "Items on Order: " & Cells(5, 8)
    If Application.MailSystem <> xlNoMailSystem Then
        ActiveWorkbook.SendMail _
            Recipients:=RecipArray, _
            Subject:=SubjArray, _
            returnReceipt:=False
        Application.MailLogoff
    Else
        MsgBox "No mail system installed."
    End If

End Sub
Sub emailComplete()
    Dim RecipArray As Variant
    Dim SubjArray As Variant
    RecipArray = Array(ActiveSheet.ComboBox3.Text, ActiveSheet.ComboBox4.Text)
    SubjArray = "Order Complete: " & Cells(5, 8)
    If Application.MailSystem <> xlNoMailSystem Then
        ActiveWorkbook.SendMail _
            Recipients:=RecipArray, _
            Subject:=SubjArray, _
            returnReceipt:=False
        Application.MailLogoff
    Else
        MsgBox "No mail system installed."
    End If

End Sub


Sub emailBackOrder()
    Dim RecipArray As Variant
    Dim SubjArray As Variant
    RecipArray = Array(ActiveSheet.ComboBox3.Text, ActiveSheet.ComboBox4.Text)
    SubjArray = "Items on Back Order: " & Cells(5, 8)
    If Application.MailSystem <> xlNoMailSystem Then
        ActiveWorkbook.SendMail _
            Recipients:=RecipArray, _
            Subject:=SubjArray, _
            returnReceipt:=False
        Application.MailLogoff
    Else
        MsgBox "No mail system installed."
    End If

End Sub
Reply With Quote
  #4 (permalink)  
Old January 5th, 2005, 09:30 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shattered Send a message via Yahoo to shattered
Default

this may or may not help.. tried your code on a variety of setups and found that it will run without vb6 - if you have office 2003 or office xp installed. I don't have a copy of office 2000 to test it with but I suspect the sendmail is having problems with 97 without the extras that vb6 installs by default for microsoft.

If I can lay my hands on a copy of office 97 I can test this theory further.

Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to run macro from another workbook? rmilward Excel VBA 2 September 26th, 2009 08:00 PM
How do i run Macro on Web virall23@yahoo.com Excel VBA 2 April 17th, 2008 01:04 AM
Run code in Macro Corey Access VBA 4 February 5th, 2007 09:54 AM
run a macro at a certain date s_gh Excel VBA 4 May 17th, 2006 06:34 AM
run macro from asp aspuser27 Excel VBA 3 January 28th, 2005 03:30 AM



All times are GMT -4. The time now is 03:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.