XL98: External Data Range Property Not Saved with Workbook (181286)
The information in this article applies to:
- Microsoft Excel 98 Macintosh Edition
This article was previously published under Q181286 SYMPTOMS
In Microsoft Excel 98 Macintosh Edition, the "Overwrite existing cells with
new data, clear unused cells" option in the External Data Range Properties
dialog box is not retained when you save and close a workbook. Instead, the
"Insert entire rows for new data, clear unused cells" option is selected.
CAUSE
This problem occurs in a workbook that already contains external data
ranges.
WORKAROUNDMicrosoft 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.
To use one or more external data ranges in a workbook and use the
"Overwrite existing cells with new data, clear unused cells" option, create
and run a Visual Basic for Applications macro to reset the option each time
you open the workbook. To do this, follow these steps:
- Write down the name of the worksheet that contains the external data
range (for example, "Sheet1").
- CONTROL-click any cell in the external data range, and click Data Range
Properties on the shortcut menu. Write down the name you see in the Name
box (for example, "ExternalData1"), and then click Cancel.
- On the Tools menu, point to Macro, and then click Visual Basic Editor
-or-
Press OPTION+F11.
- In the Project window, double-click ThisWorkbook for the workbook that
contains the external data range.
- In the Code window, click Workbook in the Object list. In the Procedure
list, click Open.
The "Private Sub Workbook_Open()" Sub procedure appears.
- In the Sub procedure, type the following line of code
Sheets("x").QueryTables("y").RefreshStyle = xlOverwriteCells
where "x" is the name of the worksheet you wrote down in step 1, and
"y" is the name of the data range you wrote down in step 2.
- On the File menu, click "Close and Return to Microsoft Excel."
For each external data range that will use the "Overwrite existing cells
with new data, clear unused cells" option, repeat these steps. When you are
finished, save the workbook.
When you open the workbook, the data ranges are formatted correctly.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
Modification Type: | Major | Last Reviewed: | 6/17/2005 |
---|
Keywords: | kbdtacode kbprb kbui KB181286 |
---|
|