¬O§_¦³¥i¯à¥Îvbs¥h¨Ï¥Îexcel³W¹º¨D¸Ñªº¼W¯q¶°?
- ©«¤l
- 1
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-3-8
- ³Ì«áµn¿ý
- 2013-3-8
|
¬O§_¦³¥i¯à¥Îvbs¥h¨Ï¥Îexcel³W¹º¨D¸Ñªº¼W¯q¶°?
§Ú²{¦b¦³¤@ӼƾǦ¡·Q¥Îexcel³W¹º¨D¸Ñªº¥\¯à¥h±o¨ìµ²ªG,²{¦bª½±µ¦bexcel°õ¦æ¬OOKªº.¦ý§Ú¥Dn¬On¦b¨ä¥L³nÅé¤W°õ¦æ.³oÓ³nÅ馳vbsªº¥\¯à,©Ò¥H§Ú§Æ±æ¥i¥Hvbs¥h§¹¦¨.¨BÆJ¦p¤U
(1)¥Îvbs¶}·sexcel
(2)¥Îvbs±Nȼg¤Jexcel
(3)¥Îvbs¥h½s¿èexcel³W¹º¨D¸Ñªº°Ñ¼Æ¦pÅܼÆÀx¦s®æ,¨î¦¡...µ¥
(4)¥Îvbs¥h°õ¦æexcelªº³W¹º¨D¸Ñ
(5)¥Îvbs±N§ÚnªºÈ±qexcelŪ¦^
(6)¥Îvbs±NexcelÃö³¬
¥H¤W§Ú§Æ±æexcel¬OÁôÂðõ¦æªº,¤£nÅã¥Ü.½Ð°Ý¦³¥i¯à°µªº¨ì¶Ü? |
|
|
|
|
|
|
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
§Ú²{¦b¦³¤@ӼƾǦ¡·Q¥Îexcel³W¹º¨D¸Ñªº¥\¯à¥h±o¨ìµ²ªG,²{¦bª½±µ¦bexcel°õ¦æ¬OOKªº.¦ý§Ú¥Dn¬On¦b¨ä¥L³nÅé ...
sample0527 µoªí©ó 2013-3-8 16:56
´£¨Ñ¤@½g¤å³¹¨Ñ±z°Ñ¦Ò(http://www.officefans.net/cdb/viewthread.php?tid=9824)
Â^¨úCasBoy ¤j¤j©Òµo¤§¤@¤å
VB¡BVBA¡BVBSªº区别§A·d²M·¡¤F吗¡H
º¥ýVBS¤£应该©MVB¡BVBA©ñ¦b¤@°_¤ñ较¡A¥¦¬O·L软«ö·Ó¦Û¤v©w义ªºActiveX Scripting规S§¹¥þ从头开©l写¦¨ªº脚¥»语¨¥¡A虽µM¥¦ªº语ªk结ÌÛ©MVB«D±`¬Û¦ü¡A¦ýVBS仅仅¨Ì¾a¦Û动¤Æ对¶H来扩¥R¨ä¥\¯à¡]¥u¦³¦Z´Á绑©w¡^¡A¥¦¤£¯à¥Îimplements来实现±µ¤f¡A¤£¥i¯à¦bVBS¨½ª½±µ¨Ï¥ÎAPI¡A没¦³VarPtr这样¯à±o¨ì«ü针ªº¨ç数¡A¦ÓVBS¯Ê¤Öªº这¨Ç¥\¯à¥¿¬OVB©MVBA©Ò¯S¦³ªº¡C当µM¡A这¤£¬O说VBS¤£¦pVB©ÎVBA¡AWindows¤w经为VBS´£¨Ñ¤F¨¬够强¤jªº¥\¯à¡A§Ú们¥i¥H¥ÎVBS来°µ脚¥»COM组¥ó¡A¦Ó¥BɦÛ动¤Æ对¶Hªº¯à¤OVBS¥i¥H说¯à¤O无¡A©Ò¥H¦³¯f¬r¥ÎVBS来写¡A对µ{§Ç员来说VBS³Ì«nªº¥\¯à²ö过¤_¥i¥H给¦Û¤vªº软¥ó´£¨Ñ§»¥\¯à¡A´N¶HVC¤¤´£¨ÑªºVBS§»¥\¯à¨º样¡Cª`·N¡AVBS¬OFreeªº¡A这©M¦bOffice¤¤¨Ï¥ÎVBA来´£¨Ñ§»¥\¯à¤£¦P¡An¶°¦¨VBA»Ýnɲ®æ¤£§Cªº许¥i证费¥Î¡A关¤_脚¥»语¨¥¥i参见MSDN¤¤Platform SDK\Tools and Languages\Scripting¡C
¨º¤\VB©MVBA¤S¦³¤°¤\¤£¦P©O¡H¦n§a¡A²´见为实¡A开©l§Ú们ªº实验§a¡I
¦pªG装¤FOffice 2000¥H¤Wª©¥»¡A¨º¤\¥´开OLEVIEW¡A点击File¤UªºView TypeLib¬d¬Ý¦ì¤_E:\Program Files\Common Files\Microsoft Shared\VBA\VBA6¤UªºVBE6.dllªº类«¬库¡A¦A¥Î¦P样ªº¤èªk¬Ý¬ÝMSVBVM60.dllªº类«¬库¡A§A会发现¥¦们ªº类«¬库°ò¥»¤W¤@¼Ò¤@样¡A°£¤FVBE6¦h¤F¤@个VBEGlobal±µ¤f©M实现这个±µ¤fªºGlobal对¶H¡A这个Global对¶H§Ú们¤]¥i¥H¦bVBA编µ{环¹Ò¡]¤ñ¦p¥ÎWORDªºVB编辑¾¹¡^¤¤¥Î对¶H浏览¾¹¬Ý¨ì¡C¥¦¦³¤G个¤èªkLoad©MUnLoad¡A还¦³¤@个UserForms属©Ê¡A这¬O¦]为VBA6¨Ï¥ÎMS Form 2.0 Form设计¾¹(FM20.dll)来设计©M¨Ï¥ÎUserFormµ¡Ê^¡]¦Ó¦bVB6¤¤¡A§Ú们¥i¥H¨Ï¥Î¦h个设计¾¹¡C¤ñ¦p³q过¨Ï¥ÎMS Form 2.0 Form设计¾¹¡A§Ú们´N¯à¦bVB¤¤¨Ï¥ÎVBA©Ò¨Ï¥ÎªºUserForm¥Î户µ¡Ê^¡^¡C©MVBAªºGlobal对¶H类¦ü¡A¦bVB¤¤¤]¦³GLobal对¶H¡A从VBªº对¶H浏览¾¹¤¤¥i¥Hª¾¹D¥¦¦bvb6.olb这个类«¬库¤¤¡A这个类«¬库´N¬O¨C个¤uµ{³£¥²须¤Þ¥ÎªºVB对¶H库¡A©Ò¦³ªºVB内¸m对¶H³£¦b这¨½¡C¦ÓVBAªºUserForm¤¤¨Ï¥Îªº对¶H³£¦bFM20.dll¤¤¡C
°£¤F¤Wz¤£¦P¥~¡AVB©MVBA还¦³¤@个³Ì¤jªº¤£¦P¡A´N¬OVBA¤£¯à¥Í¦¨EXE¥i执¦æ¤å¥ó¡A¦ý¥i¥H²q·Q¦bIDE环¹Ò¤¤VBA©MVB³£n§â¥N码编译¦¨p-code来执¦æ¡A¦Z±§Ú将¥Î实验来证©úªºÚ̬O这样¡A虽µM¦b¨ãÊ^ªº实现¤WVB©MVBA¦³«Ü¤jªº¤£¦P¡C
从¤W±ªº¤ÀªR¤W¥i¥H¬Ý¨ìVB©MVBA还¬O¦³«Ü¤j¤£¦Pªº¡A这Ïú¤£¦P¥DnÊ^现¦b编µ{环¹Ò©M对¶H结ÌÛ¤W¡A¦ý¦b¥»质¤W¥¦们¤§间却¦³着¤£¥i³ÎªÙªº¦å·½关¨t¡C¦pªG刚¤~§A¥J细¦a观¹î¤FMSVBVM60.dllªº类«¬库¡A§A´N会发现¦p¤Uªº¤ù断¡G
// Generated .IDL file (by the OLE/COM Object Viewer)
[
dllname("VBA6.DLL"),
uuid(35BFBDA0-2BCC-1069-82D5-00DD010EDFAA),
helpcontext(0x000f6ec4)
]
module Strings {
[entry(0x60000000), helpcontext(0x000f665f)]
short _stdcall Asc([in] BSTR String);
[entry(0x60000001), helpcontext(0x000f6e9f)]
BSTR _stdcall _B_str_Chr([in] long CharCode);
¡K¡K¡K¡K¡K
}
¤°¤\¡H¦bMSVBVM60.dll¤¤ªº对¶H¨ä¤èªk却©w义¦bVBA6.DLL¤¤¡H¡IVB¦w装¥Ø录¤U¤£´N¦³个VBA6.DLL吗¡H¦A¥ÎOLEVIEW¬Ý¬Ý¥¦¡A«z噻¡A¯u¬O·Q¤£¨ì¥¦©~µM©MMSVBVM60.DLLªº¤@¼Ò¤@样¡C«ç¤\¦^¨Æ¡HÓã§Ö¦A®³¥XDEPEND来¬Ý¬ÝVBA6.dll¡BMSVBVM60.dll©MVBE6.dll这¤T个DLLªº输¥X¨ç数¡C«¢¡A¤S¦³·s发现¡A§Ú们¥i¥H发现¦b¤T个DLLªº输¥X¨ç数¤¤从编号512¨ì717绝¤j³¡¤À³£¬O¤@¼Ò¤@样ªº¤@¨Ç¥Hrtc开头ªº¨ç数¡A¤ñ¦p595ªºrtcMsgBox¡]rtc¬O¤°¤\¡H应该¬ORun Time Component? Control? Code?¦³谁ª¾¹D吗¡H¡^¡A这说©ú¤T个DLL³£¦³着¬Û¦Pªº运¦æ时VBA¨ç数¡C
§Ú们¦A¥ÎDEPEND来观¹î¤@¤UVB6.EXE, §Ú们¥i¥H发现VB6.EXE¤Þ¤J¤FVBA6.DLL¤¤¤@¨Ç¥¦¯S¦³ªº¥HEb©MTip开头ªº¨ç数¡A从这¨Ç¨ç数ªº¦W称¤W¥i¥H发现¥¦们ªº¥\¯à³£¬OIDE¬Û关ªº¡A¤ñ¦p79ªºEbShowCode©M82ªºTipDeleteModule¡CVB6.EXE«ê«ê没¦³¤Þ¤J¥ô¦órtc开头ªº¨ç数¡]ª`·N¤@¡^¡C§Ú们¦A来¬Ý¬ÝMSVBVM60.DLL¡A随«K§ä¤@个¥Î¤FMsgBox¨ç数ªº编译¦Zªº¤å¥ó¡A¥ÎDEPEND来观¹î¥¦¡A´N会发现¥¦¤Þ¤JMSVBVM60.DLL输¥Xªº595号rtcMsgBox¨ç数¡]ª`·N¤G¡^¡C¦}¥B¤Þ¤JMSVBVM60.DLL¤¤«Ü¦h¥H¤U¦E线开头ªº¨ç数¡A¤ñ¦p__vbaVarAbs¡]ª`·N¤T¡^¡C¨ä实从这个¤T个"ª`·N"¤¤§Ú们¤w经¥i¥H进¦æ¤@¨Ç²q·Q¡A无论对错¡A§A¥i¥H¥ý·Q·Q¡C
¦pªG§A没¦³¸ò着§Ú°µ实验¡A¦Ó仅仅¬O¬Ý这½g¤å³¹ªº话¡A§Ú²q·Q§A应该¦³点©ü¤F¡C¦pªG§A¦Û¤v动¤â°µ¤F这¨Ç实验¡A现¦b§A应该¥R满¤FºÃ问¦Ó«æ¨Í¬Ý¨ì结论¡C©Ò¥H请¤@©wn亲¤â试¤@试¡A学习¬ã¨s问题ªº¤èªk¤ñ¬Ý结论§ó«n¡C
¨ì这¨½¦Ü¤Ö§Ú们¥i¥H±o¥X结论¡GVB©MVBA¥»´N¬O¦P©vªº©j©f¡A¥u¤£过©j©jVBªº¥\¤Òn¤ñ©f©fVBA历®`¨Ç¡C¤£过©j©j¥u会单¥´独¤æ¬O¤k强¤H¡F©f©f却¥u会³Ä¤j´Ú¡C©j©j¦³¥Í¨|¯à¤O¡A¬O¯u¥¿ªº¤k¤H¡F©f©f却¤£会¥ÍØæ¡A¦ý²`谱¬Û¤Ò¤§¹D¡A¤@µf±Ð导«ü挥¤§¤U¥i¨Ï¦o¦Ñ¤½¼W¦â¤£¤Ö¡A¦ÓVBS©O¡A¤]¬O¤j户¤H®aªº¤k¤I¡A¤£过没¦³VB©MVBA©j©fɬ¨qªº¦å统¡A娇¤p¬Â珑¤z¤£±o²Ê¬¡¥u¯à«ü挥¨Ç¦Û动§v话ªº对¶H来¤z¬¡¡A¦o乐¤_§U¤H«~¼w¦n¤£¶HVBA¨º样¥u认¤j´Ú¡AVB¡BVBA¡Bvbs¤T个¤k¤H§Ú³£³ß欢¡C |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|