-
Dec 14th, 2017, 08:15 AM
#1
Thread Starter
Registered User
VB6 Compile Error: Method or Data member not found
Hi All,
Need your help to resolve the same issue/error while debugging code got error as mentioned in Title.
Previously this code is working but in few days before my system hung and restart the machine and running this code got error on this Line(ovmyForm.wbPrintTSRP.Silent = True)
Please help check reference and component are correct.
--------------------------------------
Private Sub Run_ActionPrint()
PrintSRPs
End Sub
-------------------------------------------
Private Sub PrintSRPs()
Dim sSRP As String
Dim hFile As Integer
Dim tmpXMLString As String
Dim DblQuote As String
Dim bPrintSRPs As Boolean
Dim strStyleSheetPath As String
Dim sPath As String
Dim wbPrintTSRP As Boolean
'We need to do this otherwise the menu bar doesn't disapppear
DoEvents
DblQuote = Chr(34)
bPrintSRPs = False
strStyleSheetPath = App.Path & "\FormattoHTML.xsl"
sPath = GetSetting("LTD", "PRINT", "PATH")
msFileName = sPath & "\" & ovTSRP.nTimedSRPId & ".xml"
If msFileName = "" Then Exit Sub
HourGlass.HourGlassOn
hFile = FreeFile
Open msFileName For Output As #hFile
'The xml header comment
tmpXMLString = "<?xml version=" & DblQuote & "1.0" & DblQuote & " encoding=" & DblQuote & "iso-8859-1" & DblQuote & " ?>"
'This line applies the transform/html style to the xml
tmpXMLString = tmpXMLString & "<?xml-stylesheet href=" & DblQuote & strStyleSheetPath & DblQuote & " type=" & DblQuote & "text/xsl" & DblQuote & "?>"
'Root tag containing export date and time
tmpXMLString = tmpXMLString & "<srpexport exportdate=" & DblQuote & Format(Date, "dd-mmm-yyyy") & DblQuote & " exporttime=" & DblQuote & Time & DblQuote & "> <srps>"
Print #hFile, tmpXMLString
'append srp text to the file
sSRP = ovTSRP.XMLString
Print #hFile, sSRP
tmpXMLString = "</srps>" & vbNewLine
tmpXMLString = tmpXMLString & "</srpexport>"
Print #hFile, tmpXMLString
'Save file
Close #hFile
'Set to true otherwise the explorer screen will not close
ovmyForm.wbPrintTSRP.Silent = True
'Open the xml file
ovmyForm.wbPrintTSRP.Navigate2 msFileName
'The xml file is loading
While ovmyForm.wbPrintTSRP.Busy
'keep going still loading
DoEvents
Wend
'set the show flag to true
bWebBrowserComplete = True
'The addressbar is hidden
ovmyForm.wbPrintTSRP.AddressBar = 0
'The explorer control must be visible otherwise we get an error
ovmyForm.wbPrintTSRP.Visible = True
HourGlass.Reset
End Sub
-
Dec 14th, 2017, 03:20 PM
#2
Re: VB6 Compile Error: Method or Data member not found
Dim wbPrintTSRP As Boolean
a boolean variable has no properties or methods, so there can not be a silent property
as this is dimensioned within the procedure, it will override any other object or procedure with the same name, probably just removing that line should resolve your problem
check that the webbrowser control is still on the form
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
-
Dec 14th, 2017, 03:36 PM
#3
Re: VB6 Compile Error: Method or Data member not found
Normally I'd agree, but the use of ovmyForm.wbPrintTSRP.Silent = True means the fully qualified name is used... not the one defined locally... so it's possible it does have a .Silent property.
I tell what I really do appreciate though, is when people mention that their code gets and error but never mentions what the error is. It's like taking the car to the mechanic and saying "car gave me an error" and expecting him to fix it.
-tg
-
Dec 15th, 2017, 04:52 AM
#4
Re: VB6 Compile Error: Method or Data member not found
"car gave me an error" and expecting him to fix it.
but that is totally normal, all the time
while the OP did not post the error number, the description was pretty explicit
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
-
Dec 15th, 2017, 08:13 AM
#5
Re: VB6 Compile Error: Method or Data member not found
It was in the subject, which I usually gloss over because a great number of times, it doesn't begin to really describe the problem...
As for the car analogy... no, not really... I don't know what your experience is like, but there's usually a description of the problem, noises, steam, smoke, odor, something...
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|