|
-
Jun 16th, 2005, 09:32 PM
#1
Thread Starter
New Member
How to run InternetExplorer with long URL from VB
I use VB within MS office and would like to run IE from Excel. The codes are like these:
VB Code:
urlHeader = "http://bla.blablalalal"
Set IE = CreateObject("InternetExplorer.Application")
For r = 2 To 1000 Step 1
Str = Cells(r, 2).Value
url = urlHeader & Str
IE.Navigate (url)
While (IE.ReadyState <> 4)
Application.Wait 10
Wend
sRet = IE.Document.DocumentElement.OuterHTML
'........
Next r
This works fine when len(url)=<2048, but longer url is truncated by IE. Could you give me suggestions to get around this problem? Thanks a lot.
Nanfei
-
Jun 16th, 2005, 09:49 PM
#2
Re: How to run InternetExplorer with long URL from VB
Welcome to the Forums.
Have you tried... I'm not 100% sure it has a greater limitation but its worth a try.
VB Code:
Dim oProcess As Process
Dim oPSI As New ProcessStartInfo
oPSI.FileName = "C:\Program Files\Internet Explorer\IExplore.exe"
oPSI.Arguments = "http://www.vbforums.com"
oProcess = oProcess.Start(oPSI)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 16th, 2005, 10:06 PM
#3
Thread Starter
New Member
Re: How to run InternetExplorer with long URL from VB
Tried your suggestion, and got an error "User-defined type not defined" at line:
Dim oProcess As Process
Is there any library I should check in the reference for these codes?
-
Jun 16th, 2005, 10:24 PM
#4
Re: How to run InternetExplorer with long URL from VB
RobDog888 is off-line so I'll field this one. The Process class is in the System.Diagnostics namespace but, although I look at my own projects and see no reference and no Import, I can still use Process unqualified. If you can't, simply import the namespace or qualify the class name. Also, without RobDog888's extra code for clarity, you could also simply try:
VB Code:
Dim myProcess As Process = Process.Start("IExplore", "www.vbforums.com")
if you specifically want to use Internet Explorer. You don't have to qualify the execuatble because the Environment Path variable will sort that out. This would not be the case for all executables, of course, which is undoubtedly why RobDog888 used the full path. Alternatively, to use the default browser try:
VB Code:
Dim myProcess As Process = Process.Start("www.vbforums.com")
In fact, if you don't intend to use the Process object later, you don't even need to assign the result of Process.Start to a variable. Simply call it like a procedure:
VB Code:
Process.Start("www.vbforums.com")
Last edited by jmcilhinney; Jun 16th, 2005 at 10:29 PM.
-
Jun 16th, 2005, 10:36 PM
#5
Thread Starter
New Member
Re: How to run InternetExplorer with long URL from VB
On my computer (Windows 2000 with MS Office 2000, and I use VB in Excel), 'Process' is not recognized as an known object. Any of the codes mentioned above containing 'Process" produced an error indicating the object was not defined.
-
Jun 16th, 2005, 10:56 PM
#6
Re: How to run InternetExplorer with long URL from VB
This is a VB.NET forum. If you are using VBA then post here and if you are using VB6 or earlier then post here.
-
Jun 16th, 2005, 11:47 PM
#7
Re: How to run InternetExplorer with long URL from VB
Looks like I dropped the ball on this one jmcilhinney. 
"I use VB within MS office" so this is VBA.
Moved to VBA Forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 16th, 2005, 11:57 PM
#8
Re: How to run InternetExplorer with long URL from VB
 Originally Posted by RobDog888
Looks like I dropped the ball on this one jmcilhinney. 
"I use VB within MS office" so this is VBA.
Moved to VBA Forum.
You're forgiven (but not for the avatar ). It was nanfei's first post so they can be forgiven too, but we all generally assume that a thread in this forum is VB.NET related. I read the thread title and it still didn't really register.
-
Jun 17th, 2005, 12:08 AM
#9
Re: How to run InternetExplorer with long URL from VB
See, you missed it too J. 
Check out ShellExecute API for a possible solution since you can pass an argument of just the url.
If you think my current avatar is causing seizures then just wait for the next one.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 17th, 2005, 12:46 AM
#10
Member
Re: How to run InternetExplorer with long URL from VB
Not sure but maybe Webbrowser control??
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
|