Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:28:51+00:00 2026-06-07T16:28:51+00:00

Trying to receive website source code via Excel VBA works for approximately 4000 words,

  • 0

Trying to receive website source code via Excel VBA works for approximately 4000 words, 40000 chars. Then it stops. And I don’t know why.

Can anyone help me?

Option Explicit
Private Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000
Private Declare Function InternetOpen Lib "Wininet.dll" Alias "InternetOpenA" (ByVal lpszAgent As String, ByVal dwAccessType As Long, ByVal lpszProxyName As String, ByVal lpszProxyBypass As String, ByVal dwFlags As Long) As Long
Private Declare Function InternetReadFile Lib "Wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib "Wininet.dll" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal sUrl As String, ByVal sHeaders As String, ByVal lHeadersLength As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function InternetCloseHandle Lib "Wininet.dll" (ByVal hInet As Long) As Integer

Public Sub GetWebPageData()

  Dim hInternet, hSession, lngDataReturned As Long
  Dim iReadFileResult As Integer
  Dim sBuffer As String * 64
  Dim sTotalData As String
  Dim sUrl As String
  Dim sLine As String

  sUrl = "http://www.engadget.com/" 'Long Website here
  hSession = InternetOpen("", 0, vbNullString, vbNullString, 0)

  If hSession Then hInternet = InternetOpenUrl(hSession, sUrl, vbNullString, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0)

  If hInternet Then
    iReadFileResult = InternetReadFile(hInternet, sBuffer, 128, lngDataReturned)

    sTotalData = sBuffer

    Do While lngDataReturned <> 0
      iReadFileResult = InternetReadFile(hInternet, sBuffer, 128, lngDataReturned)
      sTotalData = sTotalData + Mid(sBuffer, 1, lngDataReturned)
    Loop
  End If

  iReadFileResult = InternetCloseHandle(hInternet)

  'WEBPAGE loaded into sTotalData
  Cells(2, 2) = sTotalData
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:28:53+00:00Added an answer on June 7, 2026 at 4:28 pm

    The issue is the line

    Cells(2, 2) = sTotalData
    

    Returning a string to a cell is limnited to 32767 characters in Excel 2007/2010, even if sTotalData is longer than that.

    Refer to this link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to receive an image from the Android Gallery via an ACTION_SEND
I'm trying to receive the html of a website. For now I've tried it
I receive the following string from one website via mechanize: 'We\x92ve' I know that
What I'm trying is to receive some data off a website which is being
I'm trying to use Paypal IPN on a website. The payment works and is
I am trying to receive a json object back from php after sending data
I am trying to receive the url image and post the image into base64
I seem to be getting this particular always when i am trying to receive
I receive the following error when trying to run my ASP.NET MVC application: The
i receive the following error when trying to implement auto-complete based on edismax type.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.