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
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: