Word Document Properties


Chapter 6: Trapping Errors and Squashing Bugs



Download 8,82 Mb.
Pdf ko'rish
bet124/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   120   121   122   123   124   125   126   127   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Chapter 6: Trapping Errors and Squashing Bugs
11_046500 ch06.qxp 12/5/06 5:35 PM Page 139


see library references used in many places in this book. For example, when
you work with the hard drive, you need to add a new library to your applica-
tion. The following section of this chapter describes how to add a reference
to a library. If you don’t include all the library references that your applica-
tion requires, the application displays a run-time error.
Recovering from an error
Recovering from an error is important. Adding recovery code means that you
can count on your program to help you overcome problems with the system
and keep your data safe. You can add two kinds of recovery code to your
program:
Code that recovers before the error happens
Code that recovers after the error happens
It’s always better to detect an error and recover from it before the error actu-
ally happens. You can always recover from a resource error, such as lack of
hard drive space, before the error happens. Likewise, you can always recover
from input errors by making the required checks and asking for the correct
input. The only time you must wait for the error to happen is when you can’t
predict the error, such as a sudden loss of power.
A common run-time error is lack of hard drive space. To add a drive-checking
feature to your program, you need to add a new library to your program. Use
the Tools

References command to display the References dialog box, as
shown in Figure 6-2. Notice that the Microsoft Scripting Runtime check box is
selected. Look for this entry in your dialog box and select it. Click OK. The
new library is ready for use.
Figure 6-2:
Use this
dialog box
to add a
new library
to your
program.
140

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   120   121   122   123   124   125   126   127   ...   207




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish