Search : in
By :

VB Code 400 error - please help

ditzysuz, on Mar 17, 2009 1:39:09 am GMT 
 Report this message to moderators

Hello,

I have a piece of code that automatically saves and send a file. However this code works fine in Excel 2000 - 2007 but doesn't work in Excel 97.

Does anyone know how to fix this problem?

Thank you in advance.
DitzySuz


Sub SaveandSend()
ThisFile = Range("C6").Value
ThisFile1 = Range("C5").Value
ThisFile2 = Range("C3").Value
ActiveWorkbook.SaveAs Filename:="Survey - " & ThisFile & ThisFile1 & ThisFile2

'Working in 2000-2007
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = "lees6@anz.com"
.Subject = "BM Survey"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


End Sub

Configuration: Windows XP
Internet Explorer 6.0

Best answers for « VB Code 400 error please help » in :
Driver damaged or missing (Code 39) ShowDriver damaged or missing (Code 39) Error message Solution Error message When installing or reinstalling drivers (drivers) a device, it is possible that Windows displays the following error message: Windows cannot load the device...
Codes and error messages for MSN Messenger ShowCodes and error messages for MSN Messenger IM_e_connect 0x81000301 The Winsock layer could not establish a connection. IM_e_invalid_server_name 0x81000302 Reserved for future use. IM_e_invalid_password 0x81000303 The...
Know the FTP Error codes ShowKnow the FTP Error codes Intro Intro Here are the most common FTP process error codes. You will notice these codes in the dialog box in your FTP application, which are very useful to know! Error Codes 110 Restart marker reply....
Download GANTT Project ShowGanttProject is a free project management tool allowing to realize GANTT diagrams to plan a project and manage the resources. GanttProject is a complete tool proposing import / export features towards Microsoft Project, as well as export functions...
Download Source Code Spell Checker ShowSource Code Spell Checker is a program that offers to check your lines of code, highlight the errors and to report errors detected. You save valuable time by limiting the reading tedious programming codes. Advantage Via the context menu, you can...
Download XviD codec ShowIt is an open source which focuses on the compression of video. Xvid video codec allows the compression and the decompression of digital videos with the aim of reducing the bandwidth during the transmission through a network. Xvid is specialized in...
Error checking ShowError checking Binary encoding is very practical for use in electronic devices such as computers, in which information can be encoded based on whether an electrical signal is present or not. However, this electrical signal may suffer disturbances...
RGB coding ShowRGB coding The RGB coding (Red, Geen, Blue), developed in 1931 by the International Lighting Commission (Commission Internationale de l'Eclairage, CIE) consists in representing the colour space with three monochromatic rays, with the following...