' Workbook Workbooks

  1. Case study: '
  2. I. ' , , - .
  3. I. Ҳ Ͳ '
  4. I. Ҳ ' ԲDzò
  5. OLE (Object Linking Embeding) - ' ' Windows
  6. " ', ".
  7. " : ' "- (1938), .

' Workbook ' Excel . : XLS ( Excel) XLA ( Excel) [9], VBA. VBA XLA, .

1.5.1. ' Workbook
Workbooks

Name ' . ! . ' SaveAs.String; . = ThisWorkbook.Name
Path . String; . = _ActiveWorkbook.Path
FullName ' , . String; . = ActiveWorkbook.FullName
Saved True, , False - . True False; / .If Not (ActiveWorkBook.Saved) ThenActiveWorkbook.SaveEnd If
WorkSheets , ' (.1.3.2).
Charts , .
Count . Long; . = Workbooks.Count

1.5.2. ' Workbook
Workbooks

ij
Add Workbooks. .Workbooks.Add
Activate ' . .Workbooks ( " .xls"). Activate
Close . :
q saveChanges True, , False - ;
q fileName True, ' ;
q routeWorkbook True, ( , )

ActiveWorkbook.Close saveChanges: = _
False

Save . .ActiveWorkbook.Save
SaveCopyAs

, ' '. :

q fileName - ' ﳿ

ActiveWorkbook.SaveCopyAs _
"ϲ Ͳò.XLS"

1.5.3. ,

.

ChDir . : ChDir path, path- '
ChDir "C: \ St" C: \ St
ChDir ".." , 1
CurDir
Kill . : Killpathname, pathname- ' Kill "C: \ St \ .xls"
MkDir . : MkDir path, path- ' MkDir "C: \ St" C: \ St , :
RmDir . : RmDirpath, path- ' RmDir "C: \ St" C: \ St , :

- Dir- . .

:

Dir[(pathname [,attributes])]

pathname- ' ;

attributes- , :

q vbNormal
q vbReadOnly
q vbHidden
q vbSystem
q vbVolume ̳ ; ,
q vbDirectory

:

1. :

Dim As String

= Dir ( "C: \ St \ .xls")

If <> "" Then _

MsgBox " .xls !" _

ElseMsgBox " .xls !"

. Dir , " .xls", , .

2. C: \ St:

Path = "C: \ St" '

= Dir (Path) ' '

i = 1

While <> ""

Cells (i, 1) .Value =

= Dir

i = i + 1

Wend

Ͳ : Dir ' , (Dir (Path)).

3.

Path = "C: \ St \ *. Xls",

Excel-.

4. :

Path = "C: \ St"

= Dir (Path, vbDirectory)

' ' ( "St", _
, - )

If <> "" ThenMsgBox " !" _

ElseMsgBox " !"




, . . | 681.3 | | | | ' | | ' | InputBox | ' Worksheet |

© um.co.ua -