Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2016, 10:23 PM
PRA007's Avatar
PRA007 PRA007 is offline Problem with function Windows 7 64bit Problem with function Office 2010 32bit
Competent Performer
Problem with function
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default Problem with function

I am trying to do following thing
Code:
Sub RPX1()
Application.ScreenUpdating = False
Dim Rng As Range, Tbl As Table, StrTxtE As String, valD As String, StrTxtD1 As String, StrTxtD2 As String, valD1 As String, StrTxt As String, StrTxtT As String, StrTxtD As String, HttpReq As Object, i As Long, j As Long, k As Long, l As Long, m As Long, n As Long, o As Long, doc As MSHTML.HTMLDocument, IE As SHDocVw.InternetExplorer
Dim wdApp As New Word.Application, wdDoc As Document
Set wdDoc = ActiveDocument
With wdDoc.Range
With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "http://search.rpxcorp.com*^13"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
End With
Do While .Find.Found
    URL = Split(.Text, Chr(13))(0)
        StrTxt = Get_RPX_Data(URL)
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
End Sub

Function Get_RPX_Data(URL As String) As String
'References to Internet Explorer & Microsoft HTML required
Dim Rng As Range, Tbl As Table, StrTxt As String, HttpReq As Object, i As Long, j As Long, StrTxtT As String, doc As MSHTML.HTMLDocument, IE As SHDocVw.InternetExplorer
Set HttpReq = CreateObject("Microsoft.XMLHTTP")
HttpReq.Open "GET", URL, False
HttpReq.send
StrTmp = HttpReq.responseText
Get_URL_Data = StrTmp
Application.ScreenUpdating = True
Set HttpReq = Nothing
End Function
I know that this is crap! Just learning to use functions.

I'm getting ByRef Argument Type Mismatch" Error

where am I making mistake(s).
Reply With Quote
  #2  
Old 01-12-2016, 11:45 PM
gmayor's Avatar
gmayor gmayor is offline Problem with function Windows 10 Problem with function Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It will help you if you add Option Explicit to the top of your modules (you can do this automatically from the VBA Editor > Tools > Options > Require Variable Declaration). Then from the Debug Menu > Compile Normal

This will show the obvious variable errors. Fix those and you may be getting somewhere.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-13-2016, 01:11 AM
PRA007's Avatar
PRA007 PRA007 is offline Problem with function Windows 7 64bit Problem with function Office 2010 32bit
Competent Performer
Problem with function
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Bingo. Just few simple mistakes.
Reply With Quote
Reply

Tags
vba, wordvba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with function Restrict Editing function disable insert textbox function IanM_01 Word 5 11-21-2015 02:29 AM
Word 2007 Review Function Problem sbudaj Word 0 10-09-2015 12:30 PM
Problem with function Function problem li roy Excel 2 02-18-2012 02:44 AM
Checkmark function problem todddesignr PowerPoint 0 07-29-2011 07:40 AM
Search Function Problem MageWind Excel 2 06-29-2011 09:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft