FASTGETGRID

Extracts values and formuals form all worksheets in a Microsoft Office Spreadsheet Object (OWC).
2.5K Downloads
Updated 26 Jan 2006

No License

FASTGETGRID extracts values and formuals form all worksheets in a Microsoft Office Spreadsheet Object (OWC). It also provides the numerical and the string variables seperately

USAGE:

>> h = actxcontrol('OWC11.Spreadsheet.11',[0 0 550 420]);
>> FastFillGrid(h, ...
{'Maturity' ,'4/15/09','' ; ...
'coupon' ,8.63 ,'ANN' ; ...
'redemption' ,100 ,'' ; ...
'Yield' ,10.1660 ,'' ; ...
'' ,'' ,'' ; ...
'dirty price' ,97.2088 ,'' ; ...
'accrued interest',6.2088 ,'' ; ...
'clean price' ,91.0000 ,'' });
>> A = FastGetGrid(h)
A =
Sheet1: [1x1 struct]
Sheet2: [1x1 struct]
Sheet3: [1x1 struct]

>> % LOOK AT SHEET 1
>> A.Sheet1
ans =
Formula: {8x3 cell}
Value: {8x3 cell}
String: {8x3 cell}
Number: {8x3 cell}

>> % LOOK AT THE FORMULAS IN SHEET 1
>> A.Sheet1.Formula
ans =
'Maturity' '39918' [NaN]
'coupon' '8.63' 'ANN'
'redemption' '100' [NaN]
'Yield' '10.166' [NaN]
[ NaN] [ NaN] [NaN]
'dirty price' '97.2088' [NaN]
'accrued interest' '6.2088' [NaN]
'clean price' '91' [NaN]

>> % LOOK AT ALL OF THE VALUES IN SHEET 1
>> A.Sheet1.Value
ans =
'Maturity' '4/15/2009' [NaN]
'coupon' [ 8.6300] 'ANN'
'redemption' [ 100] [NaN]
'Yield' [ 10.1660] [NaN]
[ NaN] [ NaN] [NaN]
'dirty price' [ 97.2088] [NaN]
'accrued interest' [ 6.2088] [NaN]
'clean price' [ 91] [NaN]

>> % LOOK AT ONLY THE STRINGS IN SHEET 1
>> A.Sheet1.String
ans =
'Maturity' '4/15/2009' []
'coupon' [] 'ANN'
'redemption' [] []
'Yield' [] []
[] [] []
'dirty price' [] []
'accrued interest' [] []
'clean price' [] []

>> % LOOK AT ONLY THE NUMBERS IN SHEET 1
>> A.Sheet1.Number
ans =
[] [] [NaN]
[] [ 8.6300] []
[] [ 100] [NaN]
[] [10.1660] [NaN]
[NaN] [ NaN] [NaN]
[] [97.2088] [NaN]
[] [ 6.2088] [NaN]
[] [ 91] [NaN]

KEY WORDS: Excel spreadsheet workbook sheet formula extract i/o input file grid

SEE ALSO:

http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=828141&objectType=author

Good MATLAB Programming Practices, graph_and_table, TechAnalTool,
MagnetGInput, Spreadsheet, df, fts, dlmreadall, robustreadcsv,
plottt, txt, db, mode, matlab, BreakAxis, Tick, Bar, plot, axisatorigin,
RegExTools, pcode_helper, SplitTxtFile, PlotDataDays, graph_and_table_,
ShadePlotForEmphasis, perl_regex_rep, DatabaseCell, Mat, SelectBox,
evaldialog, fixfilename, ExpandRegexSet, FillGrid, load, var,
SearchReplaceManyGUI, ToSavedWorkspace, AnonymousCompile,
SearchAndReplaceMany, StringIsNumber, DepSubFun, CheapHLOCPlot,
AUTOHELP, FastFillGrid, OKDLGWITHLISTBOX, QUESTDLGWITHGRID,
Spreadsheet, Structure, BullInAChinaShop, repfloat, GetSubFunNames,
REORDERPDF, SelectDatesAndSecs, WideOKDlgWithListBox,
StrrepLikeRegexprep, AddRecursivePath, SelectDateParameters,
ParseVarArgIn, AssignVarargin, CatOrSplitFile, SplitFunctions,
FixFileName, BuildKeyWhereClause, CellOrNoCellRef, AnalyseExcelFormulas

Cite As

Michael Robbins (2024). FASTGETGRID (https://www.mathworks.com/matlabcentral/fileexchange/9765-fastgetgrid), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0