Type definitions (Excel, VBA)
VBA
These are the type definitions of the VBA standard library bundled with RAS. Functions, constants and err / debug are at the top level, and types and enums are in the namespace VBA. In RAS source they are written in camelCase (msgBox, inputBox, uBound). The generated VBA uses the spelling given in the "VBA:" of each entry.
File statements such as Open / Print # / Close are written as FileIO functions ("Reading and writing files" in the cheat sheet). For reading and writing with a specified encoding, use fs.
Reference
Interface VBA.ErrObject
Holds information about the most recent run-time error.
- #
number: int
The error number. 0 means no error.
VBA:
Number- #
description: string
The description of the error.
VBA:
Description- #
source: string
The name of the object or application that raised the error.
VBA:
Source- #
helpFile: string
The path of the help file for the error.
VBA:
HelpFile- #
helpContext: int
The context ID of the topic in the help file.
VBA:
HelpContext- #
readonly lastDllError: int
The system error code set by the last DLL call.
VBA:
LastDllError- #
raise(number: int, source?: any, description?: any, helpFile?: any, helpContext?: any): void
Raises a run-time error.
VBA:
Raise- #
clear(): void
Clears all the error information.
VBA:
Clear
Interface VBA.Collection
An ordered collection of items. Indexes are 1-based, and items can also be looked up by key string.
- #
(index: any): any
Returns an item by index or key (default member).
- #
item(index: any): any
Returns an item by index or key.
VBA:
Item- #
count(): int
The number of items.
VBA:
Count- #
add(item: any, key?: any, before?: any, after?: any): void
Adds an item.
before/aftergive the position to insert at.VBA:
Add- #
remove(index: any): void
Removes an item by index or key.
VBA:
Remove
Interface VBA.DebugObject
Writes to the Immediate window and makes assertions.
- #
print(arg1?: cellValue, arg2?: cellValue, arg3?: cellValue, arg4?: cellValue, arg5?: cellValue, arg6?: cellValue, arg7?: cellValue, arg8?: cellValue): void
Writes values to the Immediate window.
VBA:
Print- #
assert(cond: boolean): void
When the condition is false, suspends execution during development.
VBA:
Assert
Enum VBA.VbMsgBoxStyle
Specifies the buttons, icon, default button and so on of a MsgBox (combined by adding).
- #
vbOKOnly = 0
- #
vbOKCancel = 1
- #
vbAbortRetryIgnore = 2
- #
vbYesNoCancel = 3
- #
vbYesNo = 4
- #
vbRetryCancel = 5
- #
vbCritical = 16
- #
vbQuestion = 32
- #
vbExclamation = 48
- #
vbInformation = 64
- #
vbDefaultButton1 = 0
- #
vbDefaultButton2 = 256
- #
vbDefaultButton3 = 512
- #
vbDefaultButton4 = 768
- #
vbApplicationModal = 0
- #
vbSystemModal = 4096
- #
vbMsgBoxHelpButton = 16384
- #
vbMsgBoxSetForeground = 65536
- #
vbMsgBoxRight = 524288
- #
vbMsgBoxRtlReading = 1048576
Enum VBA.KeyCodeConstants
Codes for keyboard keys (the KeyCode of KeyDown / KeyUp events).
- #
vbKeyLButton = 1
- #
vbKeyRButton = 2
- #
vbKeyCancel = 3
- #
vbKeyMButton = 4
- #
vbKeyBack = 8
- #
vbKeyTab = 9
- #
vbKeyClear = 12
- #
vbKeyReturn = 13
- #
vbKeyShift = 16
- #
vbKeyControl = 17
- #
vbKeyMenu = 18
- #
vbKeyPause = 19
- #
vbKeyCapital = 20
- #
vbKeyEscape = 27
- #
vbKeySpace = 32
- #
vbKeyPageUp = 33
- #
vbKeyPageDown = 34
- #
vbKeyEnd = 35
- #
vbKeyHome = 36
- #
vbKeyLeft = 37
- #
vbKeyUp = 38
- #
vbKeyRight = 39
- #
vbKeyDown = 40
- #
vbKeySelect = 41
- #
vbKeyPrint = 42
- #
vbKeyExecute = 43
- #
vbKeySnapshot = 44
- #
vbKeyInsert = 45
- #
vbKeyDelete = 46
- #
vbKeyHelp = 47
- #
vbKeyNumlock = 144
- #
vbKey0 = 48
- #
vbKey1 = 49
- #
vbKey2 = 50
- #
vbKey3 = 51
- #
vbKey4 = 52
- #
vbKey5 = 53
- #
vbKey6 = 54
- #
vbKey7 = 55
- #
vbKey8 = 56
- #
vbKey9 = 57
- #
vbKeyA = 65
- #
vbKeyB = 66
- #
vbKeyC = 67
- #
vbKeyD = 68
- #
vbKeyE = 69
- #
vbKeyF = 70
- #
vbKeyG = 71
- #
vbKeyH = 72
- #
vbKeyI = 73
- #
vbKeyJ = 74
- #
vbKeyK = 75
- #
vbKeyL = 76
- #
vbKeyM = 77
- #
vbKeyN = 78
- #
vbKeyO = 79
- #
vbKeyP = 80
- #
vbKeyQ = 81
- #
vbKeyR = 82
- #
vbKeyS = 83
- #
vbKeyT = 84
- #
vbKeyU = 85
- #
vbKeyV = 86
- #
vbKeyW = 87
- #
vbKeyX = 88
- #
vbKeyY = 89
- #
vbKeyZ = 90
- #
vbKeyNumpad0 = 96
- #
vbKeyNumpad1 = 97
- #
vbKeyNumpad2 = 98
- #
vbKeyNumpad3 = 99
- #
vbKeyNumpad4 = 100
- #
vbKeyNumpad5 = 101
- #
vbKeyNumpad6 = 102
- #
vbKeyNumpad7 = 103
- #
vbKeyNumpad8 = 104
- #
vbKeyNumpad9 = 105
- #
vbKeyMultiply = 106
- #
vbKeyAdd = 107
- #
vbKeySeparator = 108
- #
vbKeySubtract = 109
- #
vbKeyDecimal = 110
- #
vbKeyDivide = 111
- #
vbKeyF1 = 112
- #
vbKeyF2 = 113
- #
vbKeyF3 = 114
- #
vbKeyF4 = 115
- #
vbKeyF5 = 116
- #
vbKeyF6 = 117
- #
vbKeyF7 = 118
- #
vbKeyF8 = 119
- #
vbKeyF9 = 120
- #
vbKeyF10 = 121
- #
vbKeyF11 = 122
- #
vbKeyF12 = 123
- #
vbKeyF13 = 124
- #
vbKeyF14 = 125
- #
vbKeyF15 = 126
- #
vbKeyF16 = 127
Enum VBA.VbMsgBoxResult
The button pressed in a MsgBox.
Enum VBA.VbCompareMethod
Specifies how strings are compared.
Enum VBA.VbVarType
The kinds of data type VarType returns.
Enum VBA.VbDayOfWeek
Specifies a day of the week, or the first day of the week.
Enum VBA.VbFirstWeekOfYear
Specifies how the first week of the year is determined.
Enum VBA.VbStrConv
Specifies the character conversion StrConv performs (can be combined by adding).
Enum VBA.VbFileAttribute
Attributes of files and folders (combined by adding).
Enum VBA.VbAppWinStyle
Specifies how the window of a program started by Shell is shown.
Enum VBA.VbCallType
Specifies the kind of procedure CallByName calls.
Enum VBA.VbDateTimeFormat
Specifies the format of FormatDateTime.
Enum VBA.VbTriState
Three states: true, false and the default.
Enum VBA.ColorConstants
RGB values of the basic colors.
Enum VBA.VbCalendar
Specifies the calendar to use.
Enum FileIO.OpenMode
The mode in which fileOpen opens a file (VBA's Open … For <mode>). The values equal the return values of fileAttr(n, 1).
- #
forInput = 1
Reading (
For Input). Error 53 if the file does not exist.- #
forOutput = 2
Writing (
For Output). The file is recreated.- #
forRandom = 4
Reading and writing fixed-length records (
For Random).- #
forAppend = 8
Appending to the end (
For Append).- #
forBinary = 32
Reading and writing bytes (
For Binary).
Enum FileIO.OpenAccess
The operations fileOpen allows (VBA's Open … Access <access>).
Global err
const err: VBA.ErrObject
VBA: Err
Information about the most recent run-time error.
Global debug
const debug: VBA.DebugObject
VBA: Debug
Writing to the Immediate window (Debug.Print) and assertions.
Global vbCrLf
const vbCrLf: string
Carriage return and line feed (CR + LF).
Global vbCr
const vbCr: string
The carriage return character (CR).
Global vbLf
const vbLf: string
The line feed character (LF).
Global vbTab
const vbTab: string
The tab character.
Global vbNullString
const vbNullString: string
A string pointer with the value 0. Unlike the empty string "", it is used to pass NULL to DLL functions.
Global vbNullChar
const vbNullChar: string
The character with code 0.
Global vbNewLine
const vbNewLine: string
The line break of the platform (CR + LF on Windows).
Global vbBack
const vbBack: string
The backspace character.
Global vbFormFeed
const vbFormFeed: string
The form feed character.
Global vbVerticalTab
const vbVerticalTab: string
The vertical tab character.
Global vbObjectError
const vbObjectError: int
The base of user-defined error numbers (-2147221504). Make your own error numbers by adding to it.
Global dbNull
const dbNull: any
VBA: Null
VBA's Null (the value meaning there is no valid data). Use it to put Null into database fields or control values
and to return Null. Check for it with isNull(v).
RAS's null becomes Empty when stored in any and Nothing for objects (not Null).
v == null and v ?? x treat Empty, Nothing and Null all as "no value".
Function msgBox
function msgBox(prompt: any, buttons?: VBA.VbMsgBoxStyle, title?: any, helpFile?: any, context?: any): VBA.VbMsgBoxResult
VBA: MsgBox
Shows a message box and returns the button pressed.
Function inputBox
function inputBox(prompt: any, title?: any, defaultValue?: any, xPos?: any, yPos?: any, helpFile?: any, context?: any): string
VBA: InputBox
Shows an input dialog and returns the text entered. An empty string when canceled.
Function createObject
function createObject(className: string, serverName?: string): object
VBA: CreateObject
Creates a COM object from its ProgID.
Function getObject
function getObject(pathName?: any, className?: any): object
VBA: GetObject
Gets a COM object from a file or from a running instance.
Function shell
function shell(pathName: any, windowStyle?: VBA.VbAppWinStyle): double
VBA: Shell
Starts a program and returns its task ID. Does not wait for it to finish.
Function environ
function environ(expression: any): string
VBA: Environ
Returns the value of an environment variable.
Function command
function command(): string
VBA: Command
Returns the argument part of the command line the application was started with.
Function doEvents
function doEvents(): int
VBA: DoEvents
Yields to the OS so that pending events are processed.
Function timer
function timer(): float
VBA: Timer
Returns the number of seconds since midnight.
Function beep
function beep(): void
VBA: Beep
Sounds a beep.
Function appActivate
function appActivate(title: any, wait?: any): void
VBA: AppActivate
Activates the application window with the given title.
Function sendKeys
function sendKeys(str: string, wait?: any): void
VBA: SendKeys
Sends keystrokes to the active window.
Function saveSetting
function saveSetting(appName: string, section: string, key: string, setting: string): void
VBA: SaveSetting
Saves a setting in the application's area of the registry.
Function getSetting
function getSetting(appName: string, section: string, key: string, defaultValue?: any): string
VBA: GetSetting
Reads a setting from the application's area of the registry.
Function deleteSetting
function deleteSetting(appName: string, section?: any, key?: any): void
VBA: DeleteSetting
Deletes a section or key from the application's area of the registry.
Function callByName
function callByName(obj: object, procName: string, callType: VBA.VbCallType, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, arg6?: any, arg7?: any, arg8?: any): any
VBA: CallByName
Calls a property or method of an object given by its name as a string.
Function iIf
function iIf(expression: any, truePart: any, falsePart: any): any
VBA: IIf
Returns the second argument if the condition is true, the third if false. Both arguments are always evaluated.
Function choose
function choose(index: float, choice1?: any, choice2?: any, choice3?: any, choice4?: any, choice5?: any, choice6?: any, choice7?: any, choice8?: any, choice9?: any, choice10?: any): any
VBA: Choose
Returns the argument for the index (1-based).
Function switch
function switch(arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, arg6?: any, arg7?: any, arg8?: any, arg9?: any, arg10?: any): any
VBA: Switch
Checks "condition, value" pairs in order and returns the value for the first true condition.
Function isNumeric
function isNumeric(expression: cellValue): boolean
VBA: IsNumeric
Returns whether the value can be evaluated as a number.
Function isDate
function isDate(expression: cellValue): boolean
VBA: IsDate
Returns whether the value can be evaluated as a date.
Function isEmpty
function isEmpty(expression: cellValue): boolean
VBA: IsEmpty
Returns whether a Variant is uninitialized (Empty).
Function isNull
function isNull(expression: cellValue): boolean
VBA: IsNull
Returns whether the value is Null.
Function isObject
function isObject(expression: cellValue): boolean
VBA: IsObject
Returns whether the value refers to an object.
Function isArray
function isArray(varName: cellValue): boolean
VBA: IsArray
Returns whether the value is an array.
Function isError
function isError(expression: cellValue): boolean
VBA: IsError
Returns whether the value is an error value.
Function isMissing
function isMissing(argName: cellValue): boolean
VBA: IsMissing
Returns whether an optional Variant argument was omitted.
Function typeName
function typeName(varName: cellValue): string
VBA: TypeName
Returns the type name of a variable as a string.
Function varType
function varType(varName: cellValue): VBA.VbVarType
VBA: VarType
Returns a value representing the data type of a variable.
Function array
function array(...args: any[]): any
VBA: Array
Creates a Variant array of the arguments.
Function lBound
function lBound(arr: any, dimension?: int): int
VBA: LBound
Returns the lowest index of the given dimension of an array.
Function uBound
function uBound(arr: any, dimension?: int): int
VBA: UBound
Returns the highest index of the given dimension of an array. A run-time error for an empty array.
Function len
function len(s: any): int
VBA: Len
Returns the number of characters of a string, or the number of bytes needed to store a variable.
Function lenB
function lenB(s: any): int
VBA: LenB
Returns the number of bytes of a string.
Function left
function left(s: string, length: int): string
VBA: Left
Returns the given number of characters from the left of a string.
Function right
function right(s: string, length: int): string
VBA: Right
Returns the given number of characters from the right of a string.
Function mid
function mid(s: string, start: int, length?: int): string
VBA: Mid
Returns the given number of characters from the given position (1-based) of a string.
Function inStr
function inStr(start: any, string1?: any, string2?: any, compare?: VBA.VbCompareMethod): int
VBA: InStr
Returns the position (1-based; 0 if not found) where string2 first appears in string1.
VBA allows omitting the leading start, but this declaration has only the one form (start, string1, string2, compare).
The compiler emits all four arguments.
Function inStrRev
function inStrRev(stringCheck: string, stringMatch: string, start?: int, compare?: VBA.VbCompareMethod): int
VBA: InStrRev
Searches from the end of the string and returns the position found (1-based; 0 if not found).
Function replace
function replace(expression: string, find: string, replace: string, start?: int, count?: int, compare?: VBA.VbCompareMethod): string
VBA: Replace
Replaces substrings in a string with another string.
Function trim
function trim(s: string): string
VBA: Trim
Removes leading and trailing spaces.
Function lTrim
function lTrim(s: string): string
VBA: LTrim
Removes leading spaces.
Function rTrim
function rTrim(s: string): string
VBA: RTrim
Removes trailing spaces.
Function uCase
function uCase(s: string): string
VBA: UCase
Converts to uppercase.
Function lCase
function lCase(s: string): string
VBA: LCase
Converts to lowercase.
Function strComp
function strComp(string1: any, string2: any, compare?: VBA.VbCompareMethod): int
VBA: StrComp
Compares two strings and returns -1 / 0 / 1.
Function strConv
function strConv(str: any, conversion: VBA.VbStrConv, localeId?: int): any
VBA: StrConv
Converts character types (uppercase / lowercase, full-width / half-width, hiragana / katakana, Unicode).
Function strReverse
function strReverse(expression: string): string
VBA: StrReverse
Returns the string with its characters in reverse order.
Function space
function space(number: int): string
VBA: Space
Returns a string of the given number of spaces.
Function string
function string(number: int, character: any): string
VBA: String
Returns a string of the given character repeated the given number of times.
Function split
function split(expression: string, delimiter?: any, limit?: int, compare?: VBA.VbCompareMethod): string[]
VBA: Split
Returns an array (0-based) of the strings split at the delimiter.
Function join
function join(sourceArray: any, delimiter?: any): string
VBA: Join
Returns a string of the elements of the array joined with the delimiter.
Function filter
function filter(sourceArray: any, match: string, include?: boolean, compare?: VBA.VbCompareMethod): string[]
VBA: Filter
Returns only the elements of a string array that contain (or do not contain) the given string.
Function asc
function asc(s: string): int
VBA: Asc
Returns the character code (ANSI / Shift_JIS) of the first character.
Function ascW
function ascW(s: string): int
VBA: AscW
Returns the Unicode code of the first character.
Function chr
function chr(charCode: int): string
VBA: Chr
Returns the character for a character code (ANSI / Shift_JIS).
Function chrW
function chrW(charCode: int): string
VBA: ChrW
Returns the character for a Unicode code.
Function hex
function hex(number: any): string
VBA: Hex
Converts a number to a hexadecimal string.
Function oct
function oct(number: any): string
VBA: Oct
Converts a number to an octal string.
Function str
function str(number: any): string
VBA: Str
Converts a number to a string. Positive numbers get a leading space for the sign.
Function val
function val(s: string): double
VBA: Val
Converts the leading digits of a string to a number.
Function format
function format(expression: any, format?: any, firstDayOfWeek?: VBA.VbDayOfWeek, firstWeekOfYear?: VBA.VbFirstWeekOfYear): string
VBA: Format
Formats a value as a string according to a format.
Function formatNumber
function formatNumber(expression: any, numDigitsAfterDecimal?: int, includeLeadingDigit?: VBA.VbTriState, useParensForNegativeNumbers?: VBA.VbTriState, groupDigits?: VBA.VbTriState): string
VBA: FormatNumber
Formats a number as a string with the given digit grouping and number of decimal places.
Function formatCurrency
function formatCurrency(expression: any, numDigitsAfterDecimal?: int, includeLeadingDigit?: VBA.VbTriState, useParensForNegativeNumbers?: VBA.VbTriState, groupDigits?: VBA.VbTriState): string
VBA: FormatCurrency
Formats a number as a currency string.
Function formatPercent
function formatPercent(expression: any, numDigitsAfterDecimal?: int, includeLeadingDigit?: VBA.VbTriState, useParensForNegativeNumbers?: VBA.VbTriState, groupDigits?: VBA.VbTriState): string
VBA: FormatPercent
Formats a number as a percentage string.
Function formatDateTime
function formatDateTime(expression: any, namedFormat?: VBA.VbDateTimeFormat): string
VBA: FormatDateTime
Formats a date or time as a string in a predefined format.
Function cStr
function cStr(expression: any): string
VBA: CStr
Converts to String.
Function cLng
function cLng(expression: any): int
VBA: CLng
Converts to Long (RAS's int). The fraction is rounded to even.
Function cInt
function cInt(expression: any): short
VBA: CInt
Converts to Integer (RAS's short). The fraction is rounded to even.
Function cDbl
function cDbl(expression: any): double
VBA: CDbl
Converts to Double.
Function cSng
function cSng(expression: any): float
VBA: CSng
Converts to Single (RAS's float).
Function cBool
function cBool(expression: any): boolean
VBA: CBool
Converts to Boolean.
Function cDate
function cDate(expression: any): date
VBA: CDate
Converts to Date.
Function cCur
function cCur(expression: any): currency
VBA: CCur
Converts to Currency.
Function cDec
function cDec(expression: any): decimal
VBA: CDec
Converts to Decimal.
Function cByte
function cByte(expression: any): byte
VBA: CByte
Converts to Byte.
Function cVar
function cVar(expression: any): any
VBA: CVar
Converts to Variant.
Function cLngLng
function cLngLng(expression: any): long
VBA: CLngLng
Converts to LongLong (RAS's long). 64-bit Office only.
Function cLngPtr
function cLngPtr(expression: any): ptr
VBA: CLngPtr
Converts to LongPtr (RAS's ptr).
Function cvErr
function cvErr(expression: any): cellValue
VBA: CVErr
Returns an error value (Variant) with the given error number.
Function abs
function abs(number: any): any
VBA: Abs
Returns the absolute value.
Function sgn
function sgn(number: any): int
VBA: Sgn
Returns the sign as -1 / 0 / 1.
Function sqr
function sqr(number: double): double
VBA: Sqr
Returns the square root.
Function int
function int(number: any): any
VBA: Int
Returns the integer part without the fraction. For negative numbers, the next lower integer.
Function fix
function fix(number: any): any
VBA: Fix
Returns the integer part without the fraction. For negative numbers, the integer closer to 0.
Function round
function round(number: any, numDigitsAfterDecimal?: int): any
VBA: Round
Rounds to the given number of decimal places. An exact half is rounded to even (banker's rounding).
Function exp
function exp(number: double): double
VBA: Exp
Returns e raised to a power.
Function log
function log(number: double): double
VBA: Log
Returns the natural logarithm.
Function sin
function sin(number: double): double
VBA: Sin
Returns the sine. The angle is in radians.
Function cos
function cos(number: double): double
VBA: Cos
Returns the cosine. The angle is in radians.
Function tan
function tan(number: double): double
VBA: Tan
Returns the tangent. The angle is in radians.
Function atn
function atn(number: double): double
VBA: Atn
Returns the arctangent in radians.
Function rnd
function rnd(number?: any): float
VBA: Rnd
Returns a random number from 0 up to (but not including) 1.
Function randomize
function randomize(number?: any): void
VBA: Randomize
Initializes the random number generator.
Function rgb
function rgb(red: int, green: int, blue: int): int
VBA: RGB
Makes an RGB value from red, green and blue components (0 to 255).
Function qbColor
function qbColor(color: int): int
VBA: QBColor
Returns the RGB value for a color number (0 to 15).
Function now
function now(): date
VBA: Now
Returns the current date and time.
Function date
function date(): date
VBA: Date
Returns the current date.
Function time
function time(): date
VBA: Time
Returns the current time.
Function dateSerial
function dateSerial(year: int, month: int, day: int): date
VBA: DateSerial
Makes a date from a year, month and day.
Function timeSerial
function timeSerial(hour: int, minute: int, second: int): date
VBA: TimeSerial
Makes a time from hours, minutes and seconds.
Function dateValue
function dateValue(dateString: string): date
VBA: DateValue
Converts a string representing a date to a date.
Function timeValue
function timeValue(timeString: string): date
VBA: TimeValue
Converts a string representing a time to a time.
Function dateAdd
function dateAdd(interval: string, number: double, dateValue: any): date
VBA: DateAdd
Returns the date with a time interval of the given unit added.
Function dateDiff
function dateDiff(interval: string, date1: any, date2: any, firstDayOfWeek?: VBA.VbDayOfWeek, firstWeekOfYear?: VBA.VbFirstWeekOfYear): int
VBA: DateDiff
Returns the interval between two dates, counted in the given unit.
Function datePart
function datePart(interval: string, dateValue: any, firstDayOfWeek?: VBA.VbDayOfWeek, firstWeekOfYear?: VBA.VbFirstWeekOfYear): int
VBA: DatePart
Returns the value of the given unit (year, quarter, week and so on) of a date.
Function year
function year(dateValue: any): int
VBA: Year
Returns the year of a date.
Function month
function month(dateValue: any): int
VBA: Month
Returns the month of a date (1 to 12).
Function day
function day(dateValue: any): int
VBA: Day
Returns the day of a date (1 to 31).
Function hour
function hour(timeValue: any): int
VBA: Hour
Returns the hour of a time (0 to 23).
Function minute
function minute(timeValue: any): int
VBA: Minute
Returns the minute of a time (0 to 59).
Function second
function second(timeValue: any): int
VBA: Second
Returns the second of a time (0 to 59).
Function weekday
function weekday(dateValue: any, firstDayOfWeek?: VBA.VbDayOfWeek): int
VBA: Weekday
Returns the day of the week of a date as a number (Sunday is 1 by default).
Function weekdayName
function weekdayName(weekday: int, abbreviate?: boolean, firstDayOfWeek?: VBA.VbDayOfWeek): string
VBA: WeekdayName
Returns the name of the day of the week for a weekday number.
Function monthName
function monthName(month: int, abbreviate?: boolean): string
VBA: MonthName
Returns the name of the month for a month number.
Function dir
function dir(pathName?: any, attributes?: VBA.VbFileAttribute): string
VBA: Dir
Returns a file name matching the pattern and attributes. Called without arguments, it returns the next match, and an empty string when there are no more.
Function kill
function kill(pathName: any): void
VBA: Kill
Deletes files. Wildcards can be used.
Function fileCopy
function fileCopy(source: string, destination: string): void
VBA: FileCopy
Copies a file.
Function fileLen
function fileLen(pathName: string): int
VBA: FileLen
Returns the size of a file (bytes).
Function fileDateTime
function fileDateTime(pathName: string): date
VBA: FileDateTime
Returns when a file was created or last modified.
Function getAttr
function getAttr(pathName: string): VBA.VbFileAttribute
VBA: GetAttr
Returns the attributes of a file or folder.
Function setAttr
function setAttr(pathName: string, attributes: VBA.VbFileAttribute): void
VBA: SetAttr
Sets the attributes of a file.
Function mkDir
function mkDir(path: string): void
VBA: MkDir
Creates a folder.
Function rmDir
function rmDir(path: string): void
VBA: RmDir
Deletes an empty folder.
Function chDir
function chDir(path: string): void
VBA: ChDir
Changes the current folder.
Function chDrive
function chDrive(drive: string): void
VBA: ChDrive
Changes the current drive.
Function curDir
function curDir(drive?: any): string
VBA: CurDir
Returns the path of the current folder.
Function freeFile
function freeFile(rangeNumber?: any): int
VBA: FreeFile
Returns the next available file number.
Function eof
function eof(fileNumber: int): boolean
VBA: EOF
Returns whether the end of an open file has been reached.
Function lof
function lof(fileNumber: int): int
VBA: LOF
Returns the size of an open file (bytes).
Function loc
function loc(fileNumber: int): int
VBA: Loc
Returns the current position in an open file (for forRandom, the number of the last record read or written; for forBinary, the position of the last byte read or written; for text modes, the byte position ÷ 128).
Function fileAttr
function fileAttr(fileNumber: int, returnType?: int): int
VBA: FileAttr
Returns the mode of an open file (when returnType is 1; a value of FileIO.OpenMode).
Function objPtr
function objPtr(obj: any): ptr
VBA: ObjPtr
Returns the interface pointer of an object.
Function strPtr
function strPtr(s: string): ptr
VBA: StrPtr
Returns the address of a string buffer (BSTR).
Function varPtr
function varPtr(v: any): ptr
VBA: VarPtr
Returns the address of a variable.