Word Document Properties


Chapter 2: Your First VBA Program



Download 8,82 Mb.
Pdf ko'rish
bet50/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   46   47   48   49   50   51   52   53   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Chapter 2: Your First VBA Program
06_046500 ch02.qxp 12/5/06 5:33 PM Page 45


Executing the VBA program automatically
In rare cases, you need to write a VBA program that does something when
you start the associated application or perform some other task, such as
open a document. You should use this method of executing your programs
automatically only if it serves a very special purpose. Using this technique to
perform a setup that you only use once in a while doesn’t make sense. If you
set up something every day, it usually pays to make it a permanent part of
the application configuration rather than run a program to make the changes.
The smartest VBA users avoid using this technique, for two reasons. First,
many users have disabled automatic macro execution on their machines,
which means that this technique won’t work at all. The reason that people
disable automatic macro execution is that some 
crackers
(nefarious fiends
who write viruses) have used automatic macro execution as a weapon in the
past. (You can read more about macro viruses at 
http://www.cert.org/
advisories/CA-2001
-
28.html
— this is just one of over 400 sites I’ve found
that discuss this problem.) Microsoft actually tells you how to remove these
macros in the Knowledge Base article at 
http://support.microsoft.
com/?scid=kb;en-us;918064
. Second, the precise method for creating an
automatically executing program varies by application. The technique used
in Word might not work in Excel and vice versa.
The program used most often in this chapter is 
SayHello
. The name that
you give your program is important because it can have special effects on
the application. When you name your program 
AutoExec
, the application
(Word, Excel, Access, and so on) automatically executes the macro whenever
it’s started. Table 2-1 contains a list of special program names that you can
use to perform tasks automatically in some applications.

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   46   47   48   49   50   51   52   53   ...   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