To work around this behavior, use one of the following
methods.
Method 1: Reduce the amount of data to import
Instead of importing all the data into the workbook at the same time, specify a range of data to import.
Use this method two
or more times until you have imported all the data into the workbook.
Method 2: Create an existing string pool
Microsoft
provides programming examples for illustration only, without warranty either
expressed or implied. This includes, but is not limited to, the implied
warranties of merchantability or fitness for a particular purpose. This article
assumes that you are familiar with the programming language that is being
demonstrated and with the tools that are used to create and to debug
procedures. Microsoft support engineers can help explain the functionality of a
particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific requirements.
Before you import the data into the workbook, create an existing string pool with lots of unique strings in the workbook. To do
this, follow these steps:
1. | Start Excel, and open the workbook where you want to
import the data. |
2. | Add a temporary worksheet to the workbook. |
3. | Click to select the worksheet that you added in step 2, and then
press ALT+F11 to start Microsoft Visual Basic Editor. |
4. | On the Insert menu, click
Module. |
5. | In the code window, create the following macro:Public Sub GrowStringPool()
Dim row As Integer
Dim col As Integer
Dim text As String
text = "Here is some text:"
For col = 1 To 21
For row = 1 To 1000
Cells(row, col).Value = text + Str(row * col)
row = row + 1
Next
col = col + 1
Next
End Sub
|
6. | Run the macro on the new worksheet. The macro will
fill the existing string pool in the worksheet with unique strings. |
7. | Save the workbook. |
8. | Close and reopen the workbook. Excel will evaluate that the
workbook already contains a large existing string pool. This will prevent the addition of
new string data into the existing string pool. |
9. | Delete the temporary worksheet that you added in step
2. |
After you complete these steps, the data should take less time to import into the workbook.