[RESOLVED] Object doesn't support this property or method 438
Hi guys.
I've search for this problem but they all talked about Office apps or MSScript which I don't use and no other solution is viable.
I made an app well over 3 years ago and its always worked perfect with a ListView and Webbrowser control along with a DAO database with over 8,000 entries.
I've added HTML links in the code and they all show perfectly. I've since added a links to a pdf file which shows perfectly in the webbrowser but if you click on another item in the ListView it throws back a "Object doesn't support this property or method 438 frmMain lvwCodes_Click" error. It shows this error 4 times so its trying to show 4 items that are causing this error.
Code:
Private Sub lvwCodes_Click()
Dim HTMLString As String
On Error GoTo ErrHandler
If lvwCodes.SelectedItem.Text = vbNullString Then Exit Sub
HTMLString = "<html>"
HTMLString = HTMLString & "<head>"
HTMLString = HTMLString & "<meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html" & Chr(34) & ">"
HTMLString = HTMLString & "</head><body BGCOLOR=white>"
HTMLString = HTMLString & "<div align=left>"
HTMLString = HTMLString & "<font face='Arial' size='2'>"
'HTMLString = HTMLString & "<center><h2>" & "Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
End If
'EOBD II Error Code
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
'Fault Location
If lvwCodes.SelectedItem.SubItems(2) <> "" Then
HTMLString = HTMLString & "<b>Fault Location:</b><br>" & lvwCodes.SelectedItem.SubItems(2) & "<p/><p/>"
End If
'Possible Cause
If lvwCodes.SelectedItem.SubItems(3) <> "" Then
HTMLString = HTMLString & "<b>Possible Cause:</b><br>" & lvwCodes.SelectedItem.SubItems(3) & "<p/><p/>"
End If
HTMLString = HTMLString & "</font>"
HTMLString = HTMLString & "</div>"
HTMLString = HTMLString & "</body></html>"
' The following statements render the text in the HTMLString
' variable on the WebBrowser control
brwWebBrowser.Document.script.Document.Clear
brwWebBrowser.Document.script.Document.Write HTMLString
brwWebBrowser.Document.script.Document.Close
Exit Sub
ErrHandler:
MsgBox Err.Number & " " & Err.Description, 16, "frmMain lvwCodes_Click"
Open ErrorLog For Append As #1
Write #1, Err.Description & " " & Err.Number & " frmMain lvwCodes_Click"
Close #1
Resume Next
End Sub
I've tried If Err.Number = 438 Then Exit Sub in the error trap but it doesn't allow me to click on another item in the ListView and show the info.
Any suggestions?
There is another slight thing I could do with fixing. The database has 4 Fields VAG, EOBD, Fault Location, Possible Cause.
Now there are always usable values in the VAG and EOBD Fields so I just type in -. If I click on and item that has both VAG and EOBD text it shows the VAG code to centre in bold and the EOBD code next line down. But If there is only EOBD code available it show that in the top centre and again a line lower down. I don't really need to see the EOBD values twice.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
for the second part, i would assume that selecteditem text and subitems(1) are not mutually exclusive, so both criteria are running but without testing hard to be sure
which line generates the 438 error?
hard to know why it would not exit sub in your error handler
i would be interested to see your project to help debug, also to look at for application as i am often hunting up obd2 errors
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: Object doesn't support this property or method 438
The error is shown 4 times because you're using Resume Next in the Error handler. For debugging remove the error handler complete or toggle VB IDE to "break on all errors", then you'll see the first line where the error is fired.
Did you try using ListSubitems instead of Subtimes?, i think ListSubitems was added in LV from component Windows Common Controls version 6, are you using version 6 or version 5?
Re: Object doesn't support this property or method 438
Originally Posted by jcis
The error is shown 4 times because you're using Resume Next in the Error handler. For debugging remove the error handler complete or toggle VB IDE to "break on all errors", then you'll see the first line where the error is fired.
He does not need to! All he needs to do is get rid of the "Resume Next".
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Re: Object doesn't support this property or method 438
Originally Posted by Nightwalker83
He does not need to! All he needs to do is get rid of the "Resume Next".
That would be all he needs if there would be a valid reason to let the code flow enter the Error Handler when debugging code, i.e. when known errors are handled and execution resumed from there only for those errors, but this is not the case, the best you can do when debugging is telling VB to break instantly, meaning VB will stop right in the line that triggers the error and this can only be done by using toggle-> "Break on all errors" or commenting the error handling lines (just for debbuging). Offcourse you could avoid all this and just let the handler catch the error, stop there and "guess" from where it comes, or run the code line by line with F8 until you see what exact line triggers the error, but this two alternatives can't even considered when debbuging big projects with thousands of code lines and inter-modular or even inter-project calls.
Re: Object doesn't support this property or method 438
just let the handler catch the error, stop there and "guess" from where it comes
for test purposes only (in the ide) no need to guess, step into resume will take you back to the error
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
at the bottom where it shows the new item clicked on.
As I've said I've have HTML links in the Possible Cause field for years and its always worked. As I've said I've now added 39 links to a pdf file which shows perfectly. So it must be something on a pdf web link that can't be cleared.
westconn1 - I'm sure you would like to see my app if you've been hunting for one but its taken me over 3 years to find 8500 + error codes to build this database.
This app and other MV apps are posted on a few VW forums if you Google EOBD II Fault Codes Software and you can read the comments posted.
Last edited by Keithuk; Oct 6th, 2013 at 03:12 PM.
Reason: Typo
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Document
Note:
In Visual Basic 6.0, the Document property returns a string containing the name of an HTML document; in Visual Basic 2008, it returns the HTML document itself.
So that means you are trying to close a string, etc while it appears you want to do what the 2008 version of "Document" does.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Re: Object doesn't support this property or method 438
Thanks for the link Nightwalker83 but thats Visual Basic 2008 which obviously talks about Shdocvw.dll I'm using Microsoft Internet Controls ieframe.dll. If I try and load Shdocvw.dll it says its not registered when I register it fails.
I did a search on there for the WebBrowser control and I did find how to print the web page.
brwWebBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, 0, 0
'change the second parameter of the ExecWB call to OLECMDEXECOPT_DONTPROMPTUSER This causes the document to be sent to the printer without further user
'intervention. However, printing without prompting the user is not supported on Internet Explorer 5 http://support.microsoft.com/kb/315657
I haven't tried to see if this code works yet, I just show a message Right-Click on text and select Print which works for me.
I also found slightly different code for showing the text, I use:
It still works the same and it still shows the 438 error on the pdf link.
There is talk about Private Sub brwWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant) but I can't find any useful code to add in there. I don't have a direct HTML link I use <a href="http://btracing.home.xs4all.nl/FABIA/78444695-Skoda-Fabia-Electrica.pdf">Skoda-Fabia 2000-Electrical.pdf</a> from the database which shows the link perfectly and you click on it and the pdf file shows perfectly.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
Originally Posted by Keithuk
There is talk about Private Sub brwWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant) but I can't find any useful code to add in there.
If it helps, the DocumentComplete event is triggered as 'pages' are loaded. It can be triggered multiple times during one navigation, but when the requested Document is fully loaded, pDisp is set to brwWebBrowser.Application and the Document Object is available. The value of URL may or may not be the requested URL (e.g.When navigating to 'http://www.vbforums.com' the 'final' URL is 'http://www.vbforums.com/forum.php')
Code:
Private Sub brwWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If pDisp Is brwWebBrowser.Application Then
'
' Document is loaded
' It's safe to access brwWebBrowser.Document
'
End If
End Sub
Until that 'final' event is triggered it's probably not safe to access the Document Object.(Accessing it before, normally results with an 'Object Variable or With Block Not Set' type of error, or other 'strange' things)
Note that the NavigateComplete2 event is triggered before the DocumentComplete event, so should not be used in place of DocumentComplete.
Re: Object doesn't support this property or method 438
Ok guys now one has found a solution to this 438 error so I'll post a cut down version of my app which on has 461 error codes but you will see the problem.
Search for Skoda in Possible Cause that will find 34 pdf links in the database then click on the pdf link that will show OK then try and like on another item in the ListBox to bring up 438 error.
The other slight thing is if there is no code in VAG is shows the code number of EOBD twice.
If there is VAG and EOBD codes then they both show ok.
Another sight mishap I was told about a few weeks ago which I've know about for a very long time is if you click on an item in the ListView it shows but if you use the cursor keys to scroll down each item its always one number behind. I've used
Code:
Private Sub lvwCodes_KeyDown(KeyCode As Integer, Shift As Integer)
lvwCodes_Click
End Sub
Private Sub lvwCodes_KeyPress(KeyAscii As Integer)
lvwCodes_Click
End Sub
but that doesn't correct this issue, any idea's?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
i am not much help to you so far
when i click the pdf link, i get an open / save dialog, after downloading, the file opens in my pdfreader, rather than the webbrowser
i get 2 errors in resize, when i minimise your app
for your click problem, move code from keydown to keyup
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
I have a couple more pdf links to add but there isn't much point until I sort out this error.
westconn1 now you can see how my app works I'm sure you could make you own database?
Last edited by Keithuk; Oct 7th, 2013 at 05:36 PM.
Reason: Typo
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
now you can see how my app works I'm sure you could make you own database?
probably, but not much chance i will get round to it, my concentration level is not what it used to be, anyway it is good to have a look at the way you have done it
Any thoughts on how to show VAG or EOBD indidually as both will show on their own?
i will try to look at it tonight
So does the I use Adode Reader 10
i personally use foxit reader, i presume there will be some setting i can turn off, so that pdf show in the browser, though the current method of opening pdfs in my reader is my preference, again i will try to have another look tonight, anyhow you have to be aware of possible settings set by potential users
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: Object doesn't support this property or method 438
Having played around with the code it looks as if, where displaying the pdf file is concerned, you don't have a 'normal' HTMLDocument object. What I've found is that it's probably an AcroPDF object which is why you're getting the 438 error. If you add a Reference to 'Adobe Acrobat Browser Control Type Library 1.0' and use the the Object Browser in the IDE you can see that it has very few Properties, two in fact - src and MessageHandler - but quite a lot of Methods.
I tested the theory by removing the error handler and allowed the program to break on the error. I then entered
'?brwwebbrowser.Document.gotonextpage' in the Immediate Window and the next page of the pdf was displayed. (A 'normal' HTMLDocument object doesn't have a 'gotonextpage' method)
I'm not too sure that all this helps much, but I suspect you're going to have to navigate to an 'empty' page (about:blank perhaps), giving you a 'normal' HTMLDocument object, prior to Clearing and Writing the HTMLString if the current page being displayed is a pdf.
EDIT: Getting close,but still no Coconut. In lvwcodes_Click I tried:
Code:
On Error GoTo pdf
brwWebBrowser.Document.script.Document.Clear
brwWebBrowser.Document.script.Document.Write HTMLString
brwWebBrowser.Document.script.Document.Close
On Error GoTo ErrHandler
and
Code:
pdf:
brwWebBrowser.Navigate2 "about:blank"
Resume Next
which stops the error but requires you to click twice on the next item in the ListView you want to select before the page containing the details and link is displayed. Perhaps there's something in the logic that's causing that which I haven't tracked down. Might give you a starter for 10 though.
Re: Object doesn't support this property or method 438
Thanks Doogle that other error trap does work but as you say you have to click twice to see another item.
I changed it to:
Code:
ErrHandler:
If Err.Number = 438 Then
brwWebBrowser.Navigate2 "about:blank"
Resume Next
End If
MsgBox Err.Number & " " & Err.Description, 16, "frmMain lvwCodes_Click"
Open ErrorLog For Append As #1
Write #1, Err.Description & " " & Err.Number & " frmMain lvwCodes_Click"
Close #1
Resume Next
Thats the only way around it at the moment.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
I think I can nearly claim the Coconut......
Looks like the issue is one of timing but I don't fully understand it.
Made the following changes to frmMain
1. Added to the Declarations Section
Code:
Dim pdfLoaded As Boolean
2. Defined HTMLString in the Declarations Section and removed its definitions in the Form_Load and lvwCodes_Click events.
3. Added
Code:
Private Sub brwWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If pdfLoaded Then
If pDisp Is brwWebBrowser.Application Then
brwWebBrowser.Document.Script.Document.Clear
brwWebBrowser.Document.Script.Document.Write HTMLString
brwWebBrowser.Document.Script.Document.Close
brwWebBrowser.Refresh
pdfLoaded = False
End If
End If
End Sub
4. Changed the triggering of and code for error handler to
Code:
On Error GoTo pdf
brwWebBrowser.Document.Script.Document.Clear
brwWebBrowser.Document.Script.Document.Write HTMLString
brwWebBrowser.Document.Script.Document.Close
brwWebBrowser.Refresh
Exit Sub
pdf:
If Err.Number = 438 Then
pdfLoaded = True
brwWebBrowser.Navigate2 "about:blank"
Exit Sub
Else
ErrHandler:
'Search for Skoda in Possible Cause then click on the pdf link all OK
' then try and like on another item in the ListBox to bring up 438 error
MsgBox Err.Number & " " & Err.Description, 16, "frmMain lvwCodes_Click"
Open ErrorLog For Append As #1
Write #1, Err.Description & " " & Err.Number & " frmMain lvwCodes_Click"
Close #1
Resume Next
End If
End Sub
Basically it traps the error 438 and loads "about:blank" into the WebBrowser. When that Document has loaded, it then updates it with the contents of HTMLString and refreshes the Browser (in the in the _DocumentComplete event).
It's not particularly elegant but it removes the "have to click twice on second and subsequent occasions" issue.
I haven't checked to make sure the above doesn't mess up things when you follow a non-pdf link, which is why I haven't claimed the Coconut !
PS How's Stafford? Used to work there for GEC Computer Services, in Newport Road, in a previous life. Used to use the 'Bird In Hand' as a local.
Re: Object doesn't support this property or method 438
Thanks for the update Doogle I assume you tested it first?
I posted you code into the app and ran it. When I clicked on an item it just stopped responding I had to End Task it. I put a Page Break in lvwCodes_Click so I could track why it locked up it didn't get to the Page Break it just locked up again and I couldn't End Task it I turned the laptop off.
I put a Page Break in brwWebBrowser_DocumentComplete and obviously HTMLString wasn't declared It should have shown that HTMLString object or variable undefined but it didn't, I fixed that and it worked you only need a single click on an item.
I surpose it would be nice if someone wants to save that pdf file they can't right-click and save the file. I know I could search the Possible Cause for pdf but there are more pdf's in the code so electrical.pdf would find them all but I may add other online pdf files.
Any thoughts on how to show VAG or EOBD indidually as both will show correctly on their own but EOBD code on its own shows twice?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
Originally Posted by Keithuk
I assume you tested it first?
Yup - not thouroughly but It worked ok for me.
Originally Posted by Keithuk
and obviously HTMLString wasn't declared
see Item 2 in my previous post.("2. Defined HTMLString in the Declarations Section and removed its definitions in the Form_Load and lvwCodes_Click events.")
Regarding the VAG /EOBD: isn't it just a matter of moving
Code:
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
into the 'Else' clause of the preceding 'If' statement ?
i.e. from this
Code:
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
End If
'VAG,EOBD
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
to this
Code:
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
End If
Re: Object doesn't support this property or method 438
Originally Posted by Doogle
to this
Code:
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
End If
Sorry but that does nothing different from my codes only when there is VAG and EOBD it shows EOBD twice mine only shows it once.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: Object doesn't support this property or method 438
Did you move the If statement ?
That section of code should look like this
Code:
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
End If
'Fault Location
If lvwCodes.SelectedItem.SubItems(2) <> "" Then
HTMLString = HTMLString & "<b>Fault Location:</b><br>" & lvwCodes.SelectedItem.SubItems(2) & "<p/><p/>"
End If
'Possible Cause
If lvwCodes.SelectedItem.SubItems(3) <> "" Then
HTMLString = HTMLString & "<b>Possible Cause:</b><br>" & lvwCodes.SelectedItem.SubItems(3) & "<p/><p/>"
End If
The code above caters for 4 conditions with 4 different outcomes:
Code:
Condition 1: VAG = "-" , EOBD <> "-" ----> Title: "EOBD II Error Code:" Following line(eg): "Fault Location"
Condition 2: VAG <> "-" , EOBD <> "-" ----> Title: "VAG Error Code:" Following line: "EOBD II Error Code:"
Condition 3: VAG <> "-", EOBD = "-" ----> Title: "VAG Error Code:" Following line(eg): "Fault Location"
Condition 4: VAG ="-", EOBD = "-" ----> Title: "EOBD II Error Code:"(followed by "-") Following Line(eg): "Fault Location"
(If I understand you correctly, Condition 4 will not happen as one of VAG and EOBD will always have a value <> "-")
Are the above outcomes what you want ? If not, then perhaps you could describe what is expected.
Last edited by Doogle; Oct 10th, 2013 at 11:30 PM.
Re: Object doesn't support this property or method 438
Thats ok Doogle it was early in the morning (I should have gone to bed) when I tried your code and I left one line of my code in thats why EOBD showed twice.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Sorry to bring up this old thread which is [Resolved] with the help from Doogle but I have something I need to add to it rather that start a new thread as my app is already added to this one.
I've searched on here but nothing comes back thats useful.
Some of my items have a picture that shows additional details. The picture can be added to the resource file and is extracted when needed but I can't figure out how to add the picture to the web browser control.
Adding a picture to a web browser will be great for another app I'm working on where every item has a picture.
Any suggestions on how to add a jpg picture to a web browser preferably in a specific area would be gratefully appreciated.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: [RESOLVED] Object doesn't support this property or method 438
build a web page to navigate2 seems the simplest
if you just navigate to the .jpg you can not position, but a link in a web page can be positioned (and sized) to suit
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: [RESOLVED] Object doesn't support this property or method 438
Sorry to bring up this old RESOLVED thread but its related as I've already added the zip file.
Now users have commented I don't need to check for Null characters when loading the database into the ListView.
Code:
Private Sub LoadData()
Dim Sortby As String
On Error GoTo ErrHandler
lvwCodes.ListItems.Clear
Sortby = "SELECT VAG, EOBD, [Fault Location], [Possible Cause]"
Sortby = Sortby & " FROM " & "[Fault Codes]"
Sortby = Sortby & " ORDER BY VAG ASC, EOBD ASC, [Fault Location] ASC, [Possible Cause] ASC"
FileNumbers = 0
Set Rs = DBname.OpenRecordset(Sortby)
'Set Rs = DBname.OpenRecordset(DataType)
While Not Rs.EOF
Set itmX = lvwCodes.ListItems.Add(1, , CStr(Rs!VAG))
'If Not IsNull(CStr(Rs!EOBD)) Then
itmX.SubItems(1) = (Rs!EOBD)
'End If
'If Not IsNull(CStr(Rs![Fault Location])) Then
itmX.SubItems(2) = (Rs![Fault Location])
'End If
'If Not IsNull(CStr(Rs![Possible Cause])) Then
itmX.SubItems(3) = (Rs![Possible Cause])
'End If
FileNumbers = FileNumbers + 1
Rs.MoveNext
Wend
Rs.Close
lvwCodes.Refresh
Loaded = True
lvwCodes.SetFocus
lvwCodes.ListItems(1).Selected = True
lvwCodes.SelectedItem.EnsureVisible
Dim rStyle As Long
Dim R As Long
'get the current ListView style
rStyle = SendMessageLong(lvwCodes.hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
rStyle = rStyle Or LVS_EX_FULLROWSELECT
'set the new ListView style
R = SendMessageLong(lvwCodes.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle)
Exit Sub
ErrHandler:
MsgBox Err.Number & " " & Err.Description, 16, "frmMain LoadData " & FileNumbers
Open ErrorLog For Append As #1
Write #1, Err.Description & " " & Err.Number & " frmMain LoadData " & FileNumbers & " " & Date & " " & Time
Close #1
Resume Next
End Sub
I remmed out the 3 If Not IsNull(CStr(Rs!EOBD)) and removed the - blank characters from the database but when I run it, it bring back an error because they are blank.
"Invalid use of Null 94 frmMain LoadData"
Change to password database
Because this app has taken a few years to make I would like to password the database. Now I've searched on here for using a password DAO database a few years ago and I found and saved the link. I've rebuild my computers many times since so I've lost that link. I've done a resent search but nothing useful shows. I anyone can find a useful link for using a password DAO database that will be appreciated.
Sorting data alphabetically
Sortby = Sortby & " ORDER BY VAG ASC, EOBD ASC, [Fault Location] ASC, [Possible Cause] ASC"
This appeared to work ok but further investigate I thought you can't sort 4 columns alphabetically so I changed it to the first column.
Sortby = Sortby & " ORDER BY VAG ASC"
This shows ok but it sorts it in reverse, I changed ASC to DESC but that didn't cure anything, any tips on sorting would be good.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: [RESOLVED] Object doesn't support this property or method 438
Ok I posted my last comment a few weeks ago and no one has commented. You I have to ask about this in the Database section?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: [RESOLVED] Object doesn't support this property or method 438
Originally Posted by Keithuk
Ok I posted my last comment a few weeks ago and no one has commented. You I have to ask about this in the Database section?
You would probably get a faster response if you posted in there and also, the database question SHOULD really go in its own thread.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Re: [RESOLVED] Object doesn't support this property or method 438
to avoid null data problems, you can add a null string to the field return value like
Code:
if rs("myfield") & vbnullstring = whatever then
if the field contains a string, nothing is added, but a null field will now look like an empty string.... no error!
i am not totally certain that, this is what you are asking, but anyway, save all the isnull() calls
I thought you can't sort 4 columns
from sql reference
If you specify a field containing Memo or OLE Object data in the ORDER BY clause, an error occurs. The Microsoft Jet database engine doesn't sort on fields of these types.
ORDER BY is usually the last item in an SQL statement.
You can include additional fields in the ORDER BY clause. Records are sorted first by the first field listed after ORDER BY. Records that have equal values in that field are then sorted by the value in the second field listed, and so on.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
I've searched to forum for this problem but nothing shows.
I've found another problem with my app posted in post #12. There are 2 links showing YouTube video's in error code 16555 and 16558 Fuel Trim. Now the YouTube video shows but if you click on another error code in the list nothing shows, you have to close the app and restart it, this has never happened before. I know Adobe update their Flash Player every few days but I'm only using the webbrowser control ieframe.dll.
If you search for http in Possible Cause it shows other web links which work as normal apart from the ones that show a PDF file which shows the 438 error which is what this thread is about and was fixed on my later version. You can search for youtube in Possible Cause to show the 2 video links.
Does anyone have any solutions for showing YouTube links that don't lock the app please?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: [RESOLVED] Object doesn't support this property or method 438
My last comment was post 5 days ago but no one has made a comment or suggestion but my app has been downloaded 3 more times, any update on this problem?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Re: [RESOLVED] Object doesn't support this property or method 438
Does anyone have any solutions for showing YouTube links that don't lock the app please?
while i have no working solution, you could try showing the you tubes in a activex ocx so it is in a different process
possibly setting the parent of the ocx to your app
others will have much better idea about whether this will work as required and how to set it up
possibly better to start a new thread, just link back to this
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: [RESOLVED] Object doesn't support this property or method 438
Ok I see your point because the previous part was resolved but I added this on the end because its still the same app that I uploaded and that app shows exactly the same problem so users could test. I will make a new thread with a link back to this one.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.