Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Error Message &"Object Doesn't Support This Property Or Method&"


When i trry to populate my listview i get a runtime error 438 saying "Object doesn't support this property or method" . I have 4 columns in my listview and this error occured for my last column. Can anyone help me with this?
This is the code i use to populate the listview.


VB Code:
Sql = SQLCommand("51", "", "")    Set OraDynaset = OraDatabase.CreateDynaset(Sql, 0&)    If OraDynaset.RecordCount <> 0 Then    OraDynaset.MoveFirst        Do While Not OraDynaset.EOF            Set itmx = ListView1.ListItems.Add(, , OraDynaset.Fields("Company_ID"))            itmx.SubItems(1) = OraDynaset.Fields("Dept_id")            itmx.SubItems(2) = OraDynaset.Fields("Customer_id")            itmx.sumitems(3) = OraDynaset.Fields("Customer_name")                    OraDynaset.MoveNext        Loop    End IfSet OraDynaset = Nothing




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Setting A Public Sub: &"Object Doesn't Support This Property Or Method&" Error *SOLVED*
I get this error when I tried to set a Public Sub: "Object doesn't support this property or method"

It was this:

VB Code:
Public Sub CenterForm(Frm)Frm.Move (Screen.Width - Frm.Width) / 2, (Screen.Height - Frm.Height) / 2End Sub


I only have two forms so I can just use it twice but I learned Public Subs and Modules today so I want to try it this way

I tried to put it at declaration part, a module, and I even changed Public to Private to nothing but they didn't seem to work.

It says that the error is on the whole line of

VB Code:
Frm.Move (Screen.Width - Frm.Width) / 2, (Screen.Height - Frm.Height) / 2


What is wrong with it? I tried changing Frm to Form to X. Didn't work also.

Any helps appreciated...

Edit:

It worked when I got rid of (Frm) and changed the Frm's with Me and worked on just one form cause I didn't put it in a module.

But when I did, it said, "Invalid use of Me Keyword"

On

VB Code:
Me.Move (Screen.Width - Me _ 'Error on this Me..Width) / 2, (Screen.Height - Me.Height) / 2

&"object Does Not Support Property Of Method&" Error
i am making a simple game right now i get a

"object does not support property of method" error.

why

I got the code for the transparency and image loading from a demo so i dont completly understand it. Run the attached files to see what the error and where it is in the code. The demo i got it from worked so i dont no why it does not for me.

Error '438' Object Doesn't Support This Property Or Method
I'm trying to append various content into one postscript file. Using PrintOut seems the optimal way to do this - however I'm getting

Run-time error '438'
Object doesn't support this property or method.

The code I was trying to get working is:



Code:
attachmentFile.PrintOut Background:=False, Append:=True, FileName:="c:emailMessage.ps"



attachmentFile is an Outlook email attachment

Why doesn't this work?
Any help is appreciated!

Run-time Error 438: Object Doesn't Support This Property Or Method
Hi,
I use this code with Microsoft Windows Common Controls 6.0 and it works just fine:

Code:
Private Sub OLEDragDrop(Data As MSComctlLib.DataObject)
For Each varItem In Data.Files
'
Next
End Sub
But when I want to use it with Microsoft Windows Common Controls 5.0 (to have XP style) I cannot use the code anymore:

Code:
Private Sub OLEDragDrop(Data As ComctlLib.DataObject)
For Each varItem In Data.Files
'
Next
End Sub
I know that in version 5 I have to use ComctlLib instead of MSComctlLib, but still get the error:
Run-time error 438: Object doesn't support this property or method
Please help me

Error '438' Object Doesn't Support This Property Or Method - Printout Function
I'm trying to append various content into one postscript file. Using PrintOut seems the optimal way to do this - however I'm getting:

Run-time error '438'
Object doesn't support this property or method.

The code I was trying to get working is:

attachmentFile.PrintOut Background:=False, Append:=True, FileName:="c:emailMessage.ps"

attachmentFile is an Outlook email attachment

Why doesn't this work?

Any help is appreciated! Thanks!

Access 2000 - Error 438 - Object Doesn't Support This Property Or Method
I have an Access 2000 database with an embedded Common Dialog control.

The control loads a windows explorer style dialog box to browse for a file. On my machine this works fine. however, on another machine using Access 2000 it comes up with the error as detailed in the title.

I have checked for missing references in the code, but this is not the case.

Can anyone shed any light on why this may be happening - it doesnt happen in Access 97 by the way and it seems to be completely random in 2000!

Many Thanks.....

RDS Error Msg &"Object Does Not Support Property&"
I purchased a copy of “Programming VB 6.0 by Franseco Balena.  I copied the below code to try to create an RDS.DataControl object.  Each time I try to run the program I get an error code:  on the line “    dcCustomers.Recordset.MoveFirst”   that says object does not support this method or property.   I have spent forever trying to figure out why it doesn’t support “recordset.”  Does anyone know what’s wrong?

******************************************************************************************
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META content="text/html" http-equiv=Content-Type>
<TITLE></TITLE>
</HEAD>

<OBJECT classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33
 id=dcCustomers height=1 width=1>
<PARAM NAME="SQL" VALUE="SELECT * FROM Customers">
<PARAM NAME="Connect" VALUE="Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:Program FilesMicrosoft Visual StudioVb98NWind.mdb">
<PARAM NAME="ExecuteOptions" VALUE="2">
<PARAM NAME="FetchOptions" VALUE="3">
<PARAM NAME="SortDirection" VALUE="-1">
<PARAM NAME="InternetTimeout" VALUE="300000">
</OBJECT>

<BODY>
<OBJECT id=dcCustomers height=1 width=1
classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33><PARAM NAME="SQL" VALUE="SELECT * FROM Customers"><PARAM NAME="Connect" VALUE="Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:Program FilesMicrosoft Visual StudioVb98NWind.mdb"><PARAM NAME="ExecuteOptions" VALUE="2"><PARAM NAME="FetchOptions" VALUE="3"><PARAM NAME="SortDirection" VALUE="-1"><PARAM NAME="InternetTimeout" VALUE="300000"></OBJECT>


<INPUT TYPE=button ID="btnMoveFirst" VALUE="First">
<INPUT TYPE=button ID="btnMovePrevious" VALUE="Previous">

<SCRIPT LANGUAGE="VBScript">

Dim dcCustomer
Set dcCustomer = CreateObject("RDS.DataControl")
dcCustomer.Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:Program FilesMicrosoft Visual StudioVb98NWind.mdb"
dcCustomer.SQL = "SELECT * From Customers"
dcCustomer.Refresh

Sub btnMoveFirst_onClick()
    dcCustomers.Recordset.MoveFirst
End Sub

</SCRIPT></P>

</BODY>
</HTML>



Object Doesn't Support This Property Or Method
Hello everyone!

I have a strange problem:

In my company we have to update a program (exe+dll): regsvr32 /u ..., copy&pase, regsvr32 ...

On (Windows-)updated computers this programm works fine.
On old computers (no windowsupdates,...) this program says:
Object doesn't support this property or method

If I replace the new files with the old ones (+ regsvr32...) everything is alright again!?!

Does anyone know what the reason could be?

Thanks in advance!

Warappa

For Each: Object Doesn't Support This Method Or Property
I've got a collection class that I add a collection of objects to. I add them like so:


Code:
Dim TheCollection as MyCollection
Dim ThisRecord as ClassRecord

With rsLog
Do Until .EOF
Set ThisRecord = TheCollection.Add(!Heat, Date, !Etc)
.MoveNext
Loop
End With
rsLog.Close

In the Collection class I have the following:


Code:
Public Property Get NewEnum() As IUnknown
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property

I then want to loop through the collection and get all the objects back. I'm trying to use a For Each statement and I keep getting the error: "object doesn't support this method or property" Can anyone tell me why?


Code:
For Each ThisRecord In TheCollection
MsgBox ThisRecord!Date
Next

Object Doesn't Support This Property Or Method
Can I use the LockWindowUpdate on a Listview ?

I am getting the above error when I try, both when loading the listview from the form load, and when I moved the code into a Public Sub.

Object Doesn't Support The Property Or Method
Hi,

I have got a textbox item/control.When I try to use the following:

txtTransportTrucks.AddItem qrs("Trucks")
txtTransportHoursDeliver.AddItem qrs("HoursToDeliver")

I am getting object doesn't support the property or method.Please suggest how I can change the properties or method so that this textbox control can support AddItem property?

Thanks,

Object Doesn't Support This Property Or Method
Code:
Dim oUser As cUser
Dim oItem As ListItem
Dim sKey$

lvwUser.ListItems.Clear

For Each oUser In m_cUsers
sKey = CommonSub.IDToKey(oUser.pkID)
Set oItem = lvwUser.ListItems.Add(, sKey, oUser.UserAlias)
oItem.SubItems(1) = oUser.UserName
Set oItem = Nothing
Next
Set oUser = Nothing

Object doesn't support this property or method at the color line

why? i tried to solve it for 2 hours but nothing is happening
does anyone have a clue?

basically i got User class and Users(which is User Collection) Class
PS: i'm using VB 6.0

- i think i post it at wrong forum, sorry -
thx

COM Object Doesn’t Support Property Or Method
Hi
I've created ActiveX.EXE COM server (TestComp2) that has 2 classes
1. cls1 that Ipmplements IDescriptionSet interface
2. cls2 that Imlements IDescription interface

When I declare a variable of the appropriate interface it gives me an
access to the property “Text” such as
Dim oDS As IDescriptionSet
Set oU = CreateObject("TestComp2.cls1")
Print oO.Item(1).Text
But when I declare a variable of type "Object" it gives me an error:
"Run - Time error 483 object doesnt support this property or method" such as:
But object does support oO.Item(1).IDescription_Text

Dim oO As Object
Dim oDSet As IDescriptionSet

Set oDSet = CreateObject("TestComp2.cls1")
Set oO = oDSet
Print oO.Item(1).Text < -Run - Time error 483 object doesn’t support this property or method"

The code example is down below.
If you know why the object is looking for "IDescription_Text" instead of "Text" property please let me know.
Thanks.
'-----------ActiveX.EXE server ----------------------------------
Project name "TestComp2"
cls2
Option Explicit
Implements IDescription

Private Property Get IDescription_Text() As String
IDescription_Text = "Yaba - Daba - Dooo"
End Property
'----------------------------------------------------------------------------------

cls1
Option Explicit
Implements IDescriptionSet
Private Property Get IDescriptionSet_Item(ByVal vIndex As Variant) As IDescription
Dim oDescription As cls2

Set oDescription = New cls2
Set IDescriptionSet_Item = oDescription
End Property

'----------------------------------------------------------------

' ------------- Client ---------------
Option Explicit
Dim oU As IUnknown
Dim oDSet As IDescriptionSet
Dim oD As IDescription
Dim oO As Object

Private Sub Cmd_Click()

Set oU = CreateObject("TestComp2.cls1")
Set oDSet = oU

Set oO = oDSet

Print oO.Item(1).Text <-Run - Time error 483 object doesn’t support this property or method

Set oU = Nothing
Set oO = Nothing
Set oDSet = Nothing

End Sub

But object does support oO.Item(1).IDescription_Text - Why ?

Object Doesn&#039;t Support Property Or Method
I am getting a baffling error in a program I am working on. It is not the error itself but when it is occurring.

The error I am getting is “Object doesn’t support property or method.” And I get an OK or Help option….If I press OK the program continues on normally.

It is not a run-time error that can be debugged or even trapped it seems to be a VB error. The problem is it happens at random times and in no set pattern…when I break into code (ctrl-break) all the objects are set to valid properties and are using valid methods. I am at a loss.

Is there anyway to suppress this message? I have tried on error resume next statements to no avail….any suggestions?

Object Doesn't Support This Property Or Method
I get this error when i am intializing my activex control's propeties in my code.

form.MyActivexcontrol

what happens @ debug.

<Object doesn't support this property or method>

Compile DLL/Object Doesn't Support This Property Or Method
Hello all.

First off, I'm not a VB programmer. I'm a Java programmer. I have been asked by my company to create a new application based on an existing application we already have. The existing application was written in VB6, VB.NET, and C#.

I have made a change to a DLL (in VB6) in the old application (I added a function) and selected "File, Make myfile.dll" It appears to compile and create the DLL okay, but when I try to use the new function, I get the following error:

Object doesn't support this property or method: myfile.Function()

If you need any more information I'll gladly provide it, but I'm not sure how much you need. I'm 100% sure I'm doing something wrong, or I'm missing a step. Any help is greatly appreciated.

URLDownloadToFile And IBindStatusCallback And &"Object Does Not Support This Method&"
attached is a rough ActiveX EXE that my app uses to download a file from the web if it requires updating.

When the code, in the class download, is:

VB Code:
lngRetVal = URLDownloadToFile(0, "http://LocalHost/Download/" & AppName, "C:" & AppName, 0, 0)

Then the code works sport on!! Exactly how I want it to.

However, since I want a prog bar and the ability to cancel the download I need to pass it a callback address, so I use:

VB Code:
lngRetVal = URLDownloadToFile(Me, "http://LocalHost/Download/" & AppName, "C:" & AppName, 0, Me)

This works for Klienma...his code is almost the same as mine.
However...when I run my app with this changed code the URLDownload API line causes a "Object doesn't support this property or method"

Grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

I have been working on this for 6hrs now and am just going round in circles. I have no idea what is different.
I am referencing the file olelib.tlb in my app, which is what everyone else does.

So why does my code cause an error...???

I am so in need of help.

Woof

ACCESS 2003 And VB6 - Object Doesn't Support This Property Or Method
Guyz can u help me.. I have a problem. Im using XP OS, VB6, and office 2003 installed inour computer. I want to make a program that will display data from access. pls help me. thanks...

Run-Time error '438'
Object doesn't support this property or method
code:

Dim Db As Database
Dim RS As Recordset

Private Sub Form-Load()

Set DB = OpenDatabase("C:Program FilesMicrosoft Visual StudioVB98NWIND.MDB")

Set RS = DB.OpenRecordset("Customres",dbOpenSnapshot)

List1.Clear
List2.Clear

maxFields = RS.Fields.Count
For i = 0 To maxFields - 1
List1.AddItem RS.Fields(i).Name
Next

Do
List2.AddItem RS.Fields("ContactName").Value & "," & RS.Fields("CompanyName").Value

RS.MoveNext
Loop While Not RS.EOF
End Sub

VBScript &"Class Doesn't Support Automation&" Error On Some Machines...not On Others
Getting this error when I run on a certain machine...on others it runs fine.

Line: 441
Char: 7
Error: Class doesn't support Automation
Code: 800A01AE
Source: Microsoft VBScript runtime error

Here's line 441....just trying to write to Excel. I'm pretty positive the code isn't bad, like I said it works on some machines and not on others.

Code:

vWB.Sheets(1).Cells(8, 1).CopyFromRecordset rsData


So far I've tried this fix to a T and nothing...
http://www.annoyances.org/exec/forum/winxp/t1022048238

Can anyone help??

Method &"SaveAs&" Or &"Save&" Of Object &"Excel.Workbook&" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I don´t find anything.
Any ideas.
Thanks for your time
Jaime

Obejct Doesn't Support This Method Or Property Error
i had deploy my MSChart and MSFlexGrid control in my web server... the location of the cab file in the web server is
c:inetpubwwwrootprojek1cabfileMSCHRT20.cab

then in the codebase property of the control inside my project, i specify it to "http://serverName/projek1/cabFile/MSCHRT20.cab"

but when i try to run it on a client side, it gave me the "Object doesn't support this property or method".. is it means that the control is not downloaded and installed at the client computer? so what's wrong with my code?

thanks in advance for help...

good days....

ADO Command Object Returns A &"Method 'Execute' Of Object '_Connection' Failed&" Error
Hi you all,
I have a VB6 app using an Access XP back end.
I Use a function which returns a Read Only, Disconnected ADO Recordset (used to populate lists, combos etc. using minimal resources).
I use it all the time without a hitch.
It started returning a "Method 'Execute' of object '_Connection' failed" error called with a SQL which works just fine when it's used as a query in the Access DB.
Why should the Execute method fail if the SQL works well in Access' Query design window?
Any help will be highly appreciated.
Thanx!
Guy

The function is:
Function GetDisconnectedRS(ByVal sSQL As String) As ADODB.Recordset
Dim adoRS As New ADODB.Recordset
Dim ucmdGetDisconnectedRS As ADODB.Command

Set ucmdGetDisconnectedRS = New ADODB.Command
With ucmdGetDisconnectedRS
.ActiveConnection = oConnect.ConnnectionObject
.CommandType = adCmdText
.CommandText = sSQL

Set adoRS = .Execute()

End With

Set adoRS.ActiveConnection = Nothing
Set GetDisconnectedRS = adoRS

SQL:
SELECT at.ActualTestID, at.PatientID, at.TestID, at.atDate, t.testDescription, p.patFirstName, p.patSurname
FROM (tblActualTests at INNER JOIN tblTests t ON at.TestID = t.TestID) INNER JOIN tblPatients p ON at.PatientID = p.PatientID WHERE at.atDate BETWEEN #02/08/2007# AND #02/08/2007# AND Not atDone
ORDER BY at.atDate DESC, at.TestID, p.patSurname

Just a note: The function works fine few code statements before it fails, with SQLs such as "SELECT DISTINCT patFirstName FROM tblPatients ORDER BY patFirstName".
I've tryed to run "SELECT * FROM tblActualTests" and it does work but hey, what's wrong with a few Joins?
And besides which the function didn't fail me in the past with much more complex SQLs.

Thanx,
Guy

Error: &"There Was Problem Accessing Property Or Method Of OLE Objects&"
Not a great VB programmer
so need some help regarding this..
i looked een original code..and try to copy it but still gives me same error. it this a database problem or not.
error: "There was problem accessing property or method of OLE objects"

here is code, where error is..
vb Code:
Private Sub Form_Load()Dim sSQL As StringDim bflag As Boolean sSQL = " SELECT yymmdd as ExamAsOfDate, " & _            " Cast((Sum(loans)+SUM(commitments)+ SUM(lcs)+ SUM(tradefinance)" & _            "-SUM(YtdSpecificReserve))as float)  AS TotalExposure, orgunit as ExamName " & _        " FROM tblMaster " & _        " GROUP BY yymmdd, orgunit " & _        " HAVING ((yymmdd='" & Form_frmMainMenu.cmbasofdate.Value & "') " & _            " AND (orgunit='" & Form_frmMainMenu.cmbexamname.Value & "'))"Form_frmReadList.RecordSource = sSQLMe.ExamYear.Value = Form_frmMainMenu.txtexamyear.Value  bflag = bAssignReadList(Form_frmMainMenu.cmbexamname, _                Form_frmMainMenu.cmbasofdate, "", "", 0, "BORR", "RECAL")If bflag = False Then    MsgBox sErrorDesc    DoCmd.close acForm, Form_frmReadList, acSaveNoEnd If  End Sub
error points to DoCmd.acForm, Form_frmReadList, acSaveNO

VB Error: 1004 Method Range Of Object &"_Global&" Failed
Hi All,
I am using MS Visual Basic for Applications (VBA) for Excel and I am very new to this programming. In fact, I merely copied a program from a book. I apologise for the length of it, but basically I am getting error "Run-time error '1004' Method "Range" of object "_Global" failed. It is happening at the following lines:

Range("Accuracy").Select
Range("Payoff").Select
Range("Money_Mgt_Approach").Select
etc etc

Would someone be kind enough to assist please? Any help in layman terms would be appreciated.

Cheers, Phil.

The program is as follows:

Code:
Sub Simulate_Risk_of_Ruin()

'
'Define variables
'
Const NoRecords = 10001
Dim TradeResult(NoRecords) As Long
Dim EquityCurve(NoRecords) As Long
Dim Accuracy As Variant
Dim PayOff_Ratio As Variant
Dim Money_Mgt_Approach As String
Dim Fixed_Percent_Risked As Variant
Dim Ruin_Point_DrawDown As Variant
Dim Account_Start As Variant
Dim Account_Balance As Variant
Dim Account_New_High As Variant
Dim Account_DrawDown As Variant
Dim Account_DrawDown_Percent As Variant
Dim Win_or_Loss As Variant
Dim Probability_Of_Ruin As Variant
Dim RowNumber As Variant
Dim Unit_Of_Money As Integer
Dim Fixed_Dollar_Risk As Variant
Dim Number_Of_Trades As Long
Dim Number_of_Losses_Before_Ruin As Long
Dim Number_of_Trades_Since_Account_High As Long
Dim i As Long
Dim j As Long
Dim x As Long

'
'Freeze Screen
'
Application.DisplayAlerts = False
Application.ScreenUpdating = False
'
'Load Variables from Spreadsheet
'
'Load Accuracy Rate
Sheets("RiskOfRuin").Select
[b]Range("Accuracy").Select[/b]
Accuracy = Selection

'Load the Average Win to Average Loss Payoff Ration
[b]Range("Payoff").Select[/b]
PayOff_Ratio = Selection

'Load Money Management Approach
[b]Range("Money_Mgt_Approach").Select[/b]
If ActiveCell = 1 Then
Money_Mgt_Approach = "Fixed Percentage Risk Money Mgt"
Else
Money_Mgt_Approach = "Fixed Dollar Risk Money Mgt"
End If

'Load Starting Account Size
[b]Range("Start_Capital").Select[/b]
Account_Start = Selection

'Load Fixed Percentage Rate of account balance risked on each trade
[b]Range("FixedPercentage").Select[/b]
Fixed_Percent_Risked = Selection

'Load the Percentage Draw Down rate we define ruin as
Range("Ruin").Select
Ruin_Point_DrawDown = Selection

'Load the number of units of money we have in our account
Range("Unit_Of_Money").Select
Unit_Of_Money = Selection

'
'Clear the Arrays
'
For i = 1 To NoRecords
TradeResult(i) = Empty
EquityCurve(i) = 0
Next i
'
'Begin Simulating Probability of Ruin
'
Number_Of_Trades = 1
Account_Balance = Account_Start
Account_New_High = Account_Start
Account_DrawDown_Percent = 0
Number_of_Losses_Before_Ruin = 0
Fixed_Dollar_Risk = Account_Start / Unit_Of_Money

i = 1
j = 1
x = 0

Do Until Account_DrawDown_Percent >= Ruin_Point_DrawDown Or EquityCurve(i - 1) > 200000000 Or x >= 10000

'Check For New Equity High and reset number of losing trades to zero
If Account_Balance > Account_New_High Then
Account_New_High = Account_Balance
Number_of_Losses_Before_Ruin = 0
Number_of_Trades_Since_Account_High = 0
End If

'Generate random number to see whether a trade wins or loses
Win_or_Loss = Rnd

'Check for a Win
If Win_or_Loss >= (1 - Accuracy) Then
'We have a WIN!
'Calculate the profit
If Money_Mgt_Approach = "Fixed Percentage Risk Money Mgt" Then
TradeResult(j) = ((Fixed_Percent_Risked * Account_Balance) * PayOff_Ratio)
End If

If Money_Mgt_Approach = "Fixed Dollar Risk Money Mgt" Then
TradeResult(j) = Fixed_Dollar_Risk * PayOff_Ratio
End If

'Add to the equity curve
If i = 1 Then
EquityCurve(i) = Account_Start
i = i + 1
EquityCurve(i) = EquityCurve(i - 1) + TradeResult(j)
Else
EquityCurve(i) = EquityCurve(i - 1) + TradeResult(j)
End If

'We have a LOSS!
'Calculate the loss
If Money_Mgt_Approach = "Fixed Percentage Risk Money Mgt" Then
TradeResult(j) = -(Fixed_Percent_Risked * Account_Balance)
End If

If Money_Mgt_Approach = "Fixed Dollar Risk Money Mgt" Then
TradeResult(j) = -Fixed_Dollar_Risk
End If

'Add to the equity curve
If i = 1 Then
EquityCurve(i) = Account_Start
i = i + 1
EquityCurve(i) = EquityCurve(i - 1) + TradeResult(j)
Else
EquityCurve(i) = EquityCurve(i - 1) + TradeResult(j)
End If

'Add to our account balance
Account_Balance = Account_Balance + TradeResult(j)

'Calculate current drawdown and percentage drawdown
Account_DrawDown = Account_New_High - Account_Balance
Account_DrawDown_Percent = Account_DrawDown / Account_New_High

'Calculate the number of losses before ruin
Number_of_Losses_Before_Ruin = Number_of_Losses_Before_Ruin + 1

End If

'Calculate number of trades
Number_Of_Trades = Number_Of_Trades + 1
Number_of_Trades_Since_Account_High = Number_of_Trades_Since_Account_High + 1

'Increase counters
x = x + 1
j = j + 1
i = i + 1
Loop


'Calculate Probability of Ruin
Probability_Of_Ruin = Number_of_Losses_Before_Ruin / Number_of_Trades_Since_Account_High

'If the Equity Curve is above $200m or we have simulated 10,000 trades
'then we will assume ruin has been avoided.
If EquityCurve(i - 1) > 200000000 Or x >= 10000 Then
Probability_Of_Ruin = 0
End If

'Enter Probability of Ruin in Spreadsheet
Sheets("RiskOfRuin").Select
Range("Probability").Select
ActiveCell = Probability_Of_Ruin
Selection.Style = "Percent"

'
'Print Equity Curve
'
'Clear Previous Equity Curve
Columns("AA:AA").Select
Selection.Clear

'Print Equity Curve in Spreadsheet - Column AA
i = 1
Do Until i >= Number_Of_Trades + 1
Sheets(1).Cells(i, 27).Value = EquityCurve(i)
i = i + 1
Loop

'Change Chart Range
Range("AA1").Select
Selection.End(xlDown).Select
RowNumber = ActiveCell.Row

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).Values = "=RiskOfRuin!R1C27:R" & RowNumber & "C27"
ActiveWindow.Visible = False
Windows("0_Risk_of_Ruin_Simulator.xls").Activate

'Move cursor to the Probability of Ruin calculation
Range("B22").Select

'
'Refresh Screen
'
Application.DisplayAlerts = True
Application.ScreenUpdating = True

'End of Simulator


End Sub

Error 2147467259 (&"Method 'Execute' Of Object '_Connection' Failed&")
Using Visual Basic 6.0, a connction object (cnAccess as ADODB.Connection), a recordset (rsmdl3 as ADODB.Recordset) and SQLCommand1(1 to 3) as strings. Using Microsoft ActiveX Data Objects 2.8 Library.

When I try to execute a long (>1200 characters) sql command (split into 3 string variables), I get the error mentioned in Subject.

Set rsMdl3 = cnAccess.Execute(SQLCommand1(1) & SQLCommand1(2) & SQLCommand1(3), , adCmdText)

When I paste the SQL command into Access as a query, the string is split into 2 (1st is 1023 characters long), but when the carrage return between the 2 sections is deleted, the query runs fine in Access.

Any ideas about how to populate the recordset with such a long SQL command?

ERROR: &"Method 'OnAction' Of Object 'CommandBarButton' Failed&"
Hi all!

Could I ask you for some assistance in trying to solve an issue that is truely puzzling me?

I've developed an Excel application that will add some custom menu entries whenever the code library is loaded...

This has been working great for all users (50 and more), but now this one UK colleague gets a "Method 'OnAction' of object 'CommandBarButton' Failed" error. And all was working great on het machine till a couple of days ago

Does anyone have a clue on what could be happening? I've tried reinstalling, but to no avail...

I'm adding the code for reference:


Code:
' add a submenu
Set cbSubMenu = Application.CommandBars.FindControl(, , "BfgSubMenu")

If cbSubMenu Is Nothing Then
Set cbSubMenu = cbMenu.Controls.Add(msoControlPopup, 1, , , True)
With cbSubMenu
.Caption = "&BFG..."
.Tag = "BfgSubMenu"
.BeginGroup = True
End With
End If

' add menuitem to submenu (or buttons to a commandbar)
With cbSubMenu.Controls.Add(msoControlButton, 1, , , True)
.Caption = "&New Manual Billing Request"
.OnAction = ThisWorkbook.Name & "!NewBillingRequest" ==> ERROR
.Tag = "NewMBR"
End With
Thank you in advance for your much appreciated help!
Cheers, Edgard

Error :&"Method PrintOut Of Object Sheets Failed&"
I am using VBA to convert .xls file to .ps file.
If the file name is Test123.xls,the code creates Test123.ps file.
I get following error message if the excel file name has comma in it (.eg. Tes,t123.xls)
"Method PrintOut of object Sheets failed"

So I am assuming that comma is invalid character for postscript file.
Am I correct?
Is there any way to know why code fails in PrintOut method?

Thanks in advance
Meghana

Woka Vbtooltips Problem. Error Message 438.Object Doesn't Support This Properties...
Hi all

I downloaded vbtooltips project provided by woka ...
Link : http://www.vbforums.com/showthread.p...light=tooltips


I keep get an error on createtips.

error 438 : Object doesn't support this propertise or method.

How to solve this problem can anyone help me

Thanks a lot

Error -2147024769 &"Method '~' Of Object '~' Failed&"...Help!!!
Help needed,
until yesterday everything was ok with every application I use, from today I got the error Error -2147024769
"Method '~' of object '~' failed" on connecting database procedure. I’ve tried to reinstall sp6 for vb6 mdac 2.8 and Jet 4.0 but nothing the error is the same again and again… I can’t use any application with database connection (oracle & Access). Any clue on this?

&"Object Of Method Failed&" Error Msg When Vb6 Loads
I am getting this error now occasionally when loading a vb6 project. All the msgbox says is "object of method failed", no other details. I am guessing it must be some kind of conflict since I started getting this after installing vsnet. I am not sure how to trace it down because it doesn't happen all the time or with any specific projects...seems to be a random event

Has anybody else run across this message?

*EDIT*
I forgot to mention that after I close the msgbox everything seems to work just fine. Strange.


God Bless America

Edited by - IDontKnow on 4/1/2004 1:11:32 PM

'Method &"Range&" Of Object &"_Global&" Failed.' ???
Hi!

I'm trying to create a VB app that interfaces with an Excel file. I can access the file okay. Part of the code is finding the next empty row in a range. I keep getting an error in the set range part of the code.


Code:
Dim rangeSearch As Range

xlSheet.Columns("A").Select
Set rangeSearch = Selection.Find(what:="*", After:=Range("A1"), lookin:=xlFormulas, _
lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlNext)
If Not rangeSearch Is Nothing Then
FindLastRow = rangeSearch.Row
MsgBox rangeSearch.Row
End If

The error is 'Method "Range" of object "_Global" failed.'

Anyone have any idea what this means?

Thanks!!!

Method &"Range&" Of Object &"_Worksheet&" Failed....???
What ever I do on this line:

Sheet1.Range(strColumn & 3).Value = strValue

I get an error:

Method "Range" of object "_Worksheet" failed.


I tried at least 10 different ways! What's wrong?? THIS line works fine:

LColorCells = "A" & Lrow & ":" & "J" & Lrow
    Sheet1.Range(LColorCells).Font.Color = vbwhite

So what's wrong with the above line??

I've tried for example:

Sheet1.Range("" &strColumn & str(3)).Value = strValue
Sheet1.Range("'" &strColumn & 3 &"'").Value = strValue

and more...

What's strange is that THIS WORKS:

Sheet1.Range("D" & 3).Value = strValue

But of course, he would only use Column "D" and I need to loop it cause strColumn is changing.

Can someone tell me what's wrong?
Thanks!




Edited by - Zvi on 11/8/2006 10:53:20 PM

Why Does &"Method 'Open' Of Object 'Workbooks' Failed&" Become &"Method '~'...
I am trapping errors for notification purposes. When I run my program in the IDE the error is:"Method "Method 'Open' of object 'Workbooks' failed"But when I run the compiled executable it excludes information and instead becomes:"Method '~' of object '~' failed"I am not concerned with the reason for the error b/c I already know that. My concern is that the latter does not provide enough information to affectively diagnose the cause of the error.

Why does the error information get dropped in the executable? Is there any way to get it to look like the first message?

Object Doesn't Support This Property
Dim Wsh As Worksheet

Set Wsh = ActiveSheet

Wsh.PageSetup.CenterHeaderPicture.Filename = "C:DesktopRRBS Letter Logo.jpg"

Object Does Not Support This Property Or Method???
I've made a class and now im trying to use it in a form. But it keeps giving me this error (438)! I know there is something I'm doing wrong but I dont know what. Here is a sample:


VB Code:
Private Sub Command1_Click()Dim myDB As New Database        FillDatabaseFrame (myDB)End Sub Private Sub FillDatabaseFrame(Database As Database)    ...End Sub

Can I Call A Method Of An Object In Runtime By &"object Name&" String?
Private Sub FormShow(FormName as string)

dim f as Form

f = FormName //?????

load f
f.show 1

End Sub

Can I reference to an object by help of its name (string) in runtime?

Object Doesnt Support This Method Or Property
VB Code:
Option Explicit Private p As Printer Private Sub Command1_Click()    Dim str As String        str = "Testing 1 2 3"    [hl]p.Print str[/hl]    p.EndDocEnd Sub Private Sub Form_Load()    For Each p In Printers        If p.DeviceName = "CutePDF Writer" Then            Set Printer = p            Exit For        End If    NextEnd Sub

Object Doesnt Support This Property Or Method
I am currently getting an error on the highlighted line and cannot figure out why. Please advise.

The error is:

Quote:





object doesnt support this property or method





form code:

VB Code:
Private Sub Form_Load()    PageColorScheme MeEnd Sub


module code:

VB Code:
Option Explicit Public Sub PageColorScheme(frm As Form)    Dim strBC As String, strFC As String    Dim ctrl As Control        With frm        'background color, dark blue        strBC = RGB(104, 127, 217)        'foreground color, light blue        strFC = RGB(214, 223, 247)                'form background color        .BackColor = strBC                'control forecolors        For Each ctrl In .Controls            If TypeOf ctrl Is Shape Then                [hl].BorderColor = strFC[/hl]            End If        Next    End WithEnd Sub

Object Doesnt Support This Method Or Property
I want a function that makes all the textboxes,labels,comboboxes,list control, list view and date time picker controls locked
(I tried this code only for the textboxes and comobo boxes)
here is the code I tried
Code:
Public Sub GetControlNames(ByVal fname As Form)
' Get the names of ONLY labels,
' comboboxes, or textboxes
    Dim ctlCurrent As Control
    For Each ctlCurrent In fname.Controls
        If TypeOf ctlCurrent Is ComboBox Or _
           TypeOf ctlCurrent Is TextBox Then
               fname.ctlCurrent.name.Locked = True
        End If
    Next
End Sub


but gives error
"Object doesnt support this method or property.
Q1-- how to remove this error
Q2--- I 've also included the date time picker control but it says user defined datatype is not defined How to solve htis problem.

438: Object Doesnt Support This Property Or Method
I have a couple of classes here, one is a downlaoder, and the other is a download manager

the functionality is such that a downloader could operate without a download manager, but not the other way round. the user interacts with the downloader, and the manager is mostly silent, but emits events that the user can listen to if they wish. the two communicate using events;

an attempt to download when a download is already in progress, results in the url being passed to the download manager, which queues it. when the downloader emits a completed event, the manager will check its queue, and if there are remaining entries, they will be downloaded

each class hence has access to the other (im using class modules).. creating a new downloader causes the creation of a new manager. at the moment, im getting error 438 in the Class_initialize of the downloader.. it successfully does a:

Set dm = new DownloadManager 'dm is a Private dm as DownloadManager

the class_initialize for the Download Manager runs correctly.
once created, the manager is told who it's owner is, witha dm.setowner(me)
but instead of going to the SetOwner(ByRef owner as Downloader), the class_terminate of the manager is called (why?) and then the error is shown

any explanation?

Solution&gt; Error: &"&"&"&"&amp;H8007007E (-2147024770) The Specified Module Cannot Be Found&"&"&"
Hello

This is the error what i am getting after installing a package of one of my module on user testing machine.
The same module being working fine on others.


What can be the reason for this and what can be the probable solution for this?

Sandeep

Run-time Error &"Class Does Not Support Automation&"
I installed a new application written in VB6 on a machine that does not have VB or MS Office. The application using ADO to open an Access Database. When I run the application, I get an error "Run-time error '430'. Class does not support Automation or does not support expected interface. Has anyone seen this error or know what this error is? Please post some tips.

Thanks!!!

Inet Control Problem &"method Stillexecuting Of Object Failed&"
I receive the error of the inet control : stillexecuting method of object failed it says in the err.description.

The control works fine for hours and hours and suddenly this...

It is after an PUT command...

code :
    onerror goto skip
    PUT someting something

    while inetcontrol.stillexecuting
        
        doevents

    wend
    
    skip:
    err.number
    err.description

end code piece

so a minute later then the put command is fired i receive the error...after working for hours and hours like this...

real bogus like this, always need to shut down the program and restart...

some ideas would be welwome...

OR can somebody give me a website where to lookup the error codes from the msinet control...? and why those errorcodes occur....?

nitro

Word Mail Merge Object &"execute&" Method
I am pulling data from various sources and storing them in a temporary table in a MDB file. Then through code I open an invisible instance of Word 2000, open a document with Mail Merge fields in it, set the Mail Merge's datasource with SQL defining records from the MDB file, set the Mail Merge Object to have the "SendToPrinter" property and then invoke the "execute" method. At this point in the program a printer dialog box opens and expects the user to click the "OK" button in order to print the document created through Mail Merge. The problem with this approach is that I am sending thousands of documents to the printer spool so it is impractical to have the user click the printer dialog box "OK" button for each document.

I need a way to have the document automatically sent to the printer spool right after invoking the "execute" method of the Mail Merge Object. It seems like all flow of the program stops once the "execute" method is invoked. I have unsuccessfully tried to use the "Dialogs" collection in Word, the SendKeys statement and the DoEvents function to get the printer dialog box to accept a command from code to simulate that the user hit the "OK" button. I don't care about the fact that the dialog box shows up but I have to find a way to automatically print the document, so I can loop through to repeat the process 4 or 5 thousand times.

I don't know much about sub-classing or hooking, but I believe there could be a solution along those lines. I also thought about but haven't tried to use the "WithEvents" declaration of the Word objects. Any and all help with this problem would be greatly appreciated.

&"Illegal Operation&" On Executing SaveAs Method Of Excel.Worksheet Object
Hi everybody,

I have installed a database application at my client's office. I am using VB 6.0 on Windows 2000 Professional and my client's operating system is Windows 98. The print option of one of my entry modules in the application, creates an Excel Worksheet and saves it with a file name using Excel automation objects. When I compile the EXE file of the application on my computer and copy it to my client's computer, on executing the SaveAs method of the Excel.Worksheet object, the error message "This program has performed an illegal operation and will be shut down..." shows up. But when I compile the EXE file of the application on my client's computer, it works absolutely fine. My client's version of Excel is 2000 and that of mine is 2002. Is that the reason or is it something else?

Method Range Of Object &"_Global&" Failed
Run-time error '1004'


Code:
Sheets("Query").Select
If Range(J18) = "3" Then
Sheets("test").Select
Rows("18:18").Select
Selection.Insert Shift:=xlDown
Rows("19:19").Select
Selection.Insert Shift:=xlDown
Range("A19").Select
ActiveCell.FormulaR1C1 = "0"
Range("A18").Select
ActiveCell.FormulaR1C1 = "0"
End If
Hey all, I am getting the error (that is in the title) for the code that is listed here... it references the bolded line... what does this mean? and how can I fix it?

Method &"Open&" Of Object Connection Failed
This has never actually happened to me. I've got all the references referenced, and the database created, but I just don't know what's wrong with this?

Code:
Dim cn As ADODB.Connection
Public AppPath As String

Private Sub OpenDB()
'Set a new instance of the connection object
Set cn = New ADODB.Connection

'Set the connection string
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppPath & _
"SASI.mdb;"

'Open the connection
cn.Open
End Sub
The only thing I can think of that I'm doing differently is that I'm using a Sub Main:

Code:
Sub Main()
'Check if App.Path is in a root directory or not
If Mid$(App.Path, Len(App.Path) - 1, 1) = "" Then
'App.Path has a trailing slash
AppPath = App.Path
Else
'It doesn't...
AppPath = App.Path & ""
End If

'Let's open the DB
Call OpenDB
End Sub
Any ideas?

&"Method 'Range' Of Object '_Globa' Failed&" ??
Hi!

Im trying to make an app that interacts with an Excel file. I can access the file okay. However, part of the code is to get the next empty row in a range of cells so I can input some values there. I keep getting the error in my subject on the Set rangeSearch line...


Code:
Dim rangeSearch As Range

xlSheet.Columns("A").Select
Set rangeSearch = Selection.Find(what:="*", After:=Range("A1"), lookin:=xlFormulas, _
lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlNext)
If Not rangeSearch Is Nothing Then
FindLastRow = rangeSearch.Row
MsgBox rangeSearch.Row
End If



Any help would be appreciated.

Thanks!!!

&"Font Does Not Support Style&" Error
I'm trying to figure out a work-around for this problem. I keep getting an error message saying

"Font 'Monotype Corsiva' does not support style 'Regular'"

Is there any way to check if a font supports a style? I know I could just hardcode this is, but is there a way to check if a font supports a certain style, to help prevent other similar errors?

Thanks in advanced.

Copyright © 2005-08 www.BigResource.com, All rights reserved