Search notes:

Excel function: info

info(what) evaluates to a string or number that corresponds to the value of one of the following items:
what comment
directory Compare with =cell("directory")
numfile
origin Evaluates to the top left cell that is visible.
osVersion
recalc Returns the mode of recalculation
release
system
memavail available in earlier versions, now returns #N/A
memused available in earlier versions, now returns #N/A
totmem available in earlier versions, now returns #N/A

Simple VBA example

option explicit

sub main() ' {


  '
  ' The following evaluates to something like
  '   C:\Users\REN~1\AppData\Local\Temp\[bla.xlsm]Sheet1
  '
    cells(3, 2) = "directory"
    cells(4, 2) = "numfile"
    cells(5, 2) = "origin"
    cells(6, 2) = "osVersion"
    cells(7, 2) = "recalc"
    cells(8, 2) = "release"
    cells(9, 2) = "system"

    cells(2,3)  = "info(...)"
    range(cells(3,3), cells(9,3)).formulaR1C1 = "=info(RC[-1])"

    cells(3,4) = "cell(""filename"")
    cells(3,5).formula="=cell(""filename"")"

    activeSheet.usedRange.columns.autoFit

  '
  ' In order for info("directory") to return a value,
  ' we need to save the current workbook:
  '
    activeWorkbook.saveAs _
       fileName   := environ("TEMP") & "\" & "info.xlsm" , _
       fileFormat := xlOpenXMLWorkbookMacroEnabled

end sub ' }
Github repository about-Excel, path: /functions/info.vb

See also

info is a volatile function.
cell() returns information about the formatting, location, or contents of a cell

Index