ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   External Data Range Name doesn't refresh (https://www.excelbanter.com/excel-programming/361266-external-data-range-name-doesnt-refresh.html)

KHanna

External Data Range Name doesn't refresh
 
I have a problem when running the code below. Although I refresh the
external data, the name "External Data" references the range when I first
called the procedure. (When selecting the range, the original range is
highlighted.) It doesn't recognize the fact that I updated the range using
"GetHist", which created a new .csv file, and therefore, a new external data
range upon refreshing.

When I run the procedure again, it correctly stores the newly-defined range
(i.e., "External Data").

Please Help!

Sub getexternaldata()
GetHist 'creates .csv file
ActiveWorkbook.RefreshAll 'refreshes ODBC external data range that imports
a .csv file
Range("Sheet1!ExternalData").Select
End Sub


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com