Excel creating its own named ranges?

chuggins143

Board Regular
Joined
Nov 10, 2009
Messages
100
Anyone ever see Excel making its own named ranges?

Scenario... (Win7 Ent., Office Pro Plus 2013)
I have a data acquisition system that works in conjunction with LabVIEW to take data for our products... I use Excel to layout the test parameters and individual points. These targets are sent to LabVIEW, it runs the hardware side and once the hardware is dialed in to the specified point, it runs a routine that saves the data to a text (regular .txt) file. Once the routine is complete, LabVIEW will reach into Excel and run some macros that will go out and collect the data in the txt file, and then deletes the txt file. It appears that each time it collects the data it will also build a named range that will appear in my name manager. Here's the macro I'm using to pull the data in (below)... Is there something in there that I'm not seeing that would generate a named range?

Thanks!
Chad
Code:
Sub Get_2()
'
' Get2 Macro
' Macro recorded 1/12/2010 by Chad
'
Dim Points1 As Integer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


clear1      'Clears the cells that it's about to write to...
    


Sheets("RawData").Select
    With ActiveSheet.QueryTables.add(Connection:="TEXT;C:\NI\RR-Templates\RR_Data2.txt", _
        Destination:=Range(Range("DataLoc").Value))
        .Name = "RawData"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = False
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    
    
 'NEW SECTION FOR SINGLE DIGIT DATA!!!!
     With ActiveSheet.QueryTables.add(Connection:="TEXT;C:\NI\RR-Templates\RR_Data3.txt", _
        Destination:=Range(Range("SingleDigitDataLoc").Value))
        .Name = "RawData"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = False
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
  'END NEW SECTION FOR SINGLE DIGIT DATA!!!!
  
  
Range(Range("TimeLoc").Value) = Now()
Points1 = (Range("Points1").Value)


GetSound1


Sheets("Data1").Select
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic


End Sub
 
Last edited by a moderator:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I don't see anything you've posted that would do that, but you have not shown GetSound1 or clear1. In your shoes, I would embed calls to use a debug subroutine like this one:

Code:
Sub CountNames()
    Dim S As String
    Dim WBNameCount As Long, WSNameCount As Long
    Dim WS As Worksheet

    With ActiveWorkbook
        WSNameCount = 0
        WBNameCount = .Names.Count
        For Each WS In .Worksheets
            WSNameCount = WSNameCount + WS.Names.Count
        Next WS
        Debug.Print "There are " & WBNameCount & " workbook named ranges & " & WSNameCount & " worksheet named ranges in " & .Name
    End With
End Sub

at various places in my code and use it to see where named ranges are being created

 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,656
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top