ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ©I¥s¥~³¡¿W¥ß°õ¦æÀÉ®×¥¨¶°

[µo°Ý] ©I¥s¥~³¡¿W¥ß°õ¦æÀÉ®×¥¨¶°

½Ð°Ý¤j¤j­Ì¡A·Q¥ÎAÀÉ®×µ{¦¡½X©I¥s¿W¥ß°õ¦æBÀÉ®×sub msg()¡A   
    Dim xlApp As Excel.Application
    Dim book As Excel.Workbook
    Dim sheet As Excel.Worksheet
    Set xlApp = CreateObject("excel.Application")
    Set book = xlApp.Workbooks.Open("D:\¤½¦¡.xls")
    ¦¹³B¥i¥H¿W¥ß°õ¦æ¶}±ÒBÀÉ®×

    Application.Run "'D:\¤½¦¡.xls'!Module1.msg"
    ¦¹³BµLªk¥H¿W¥ß°õ¦æBÀÉ®×msg()¡A¤´¥HAÀÉ®×°õ¦æmsg()
  
    ½Ð°Ý¤j¤j­Ì¸Ó¦p¦ó¼¶¼g©O?  
    ½Ð«ü¾É«ü¾É¡AÁÂÁÂ
§Ú¬O´µ¦h

¥»©«³Ì«á¥Ñ reangame ©ó 2021-7-16 00:07 ½s¿è

¦^´_ 10# singo1232001


https://docs.microsoft.com/zh-tw/office/vba/api/excel.application.automationsecurity
https://ithelp.ithome.com.tw/articles/10159964
¤£ª¾¹D¦³¨S¦³¥Î¡A·q½Ð°Ñ¦Ò¬Ý¬Ý
§Ú¬O´µ¦h

TOP

3.rar (32.78 KB) ¦^´_ 10# singo1232001
§Ú¬O´µ¦h

TOP

¥»©«³Ì«á¥Ñ reangame ©ó 2021-7-15 08:51 ½s¿è

¦^´_ 10# singo1232001


³ø§isingo1232001¤j¤j¡A¤p§Ì¬O2003ª©¥»¡A¤p§Ì©|¥¼²z¸Ñ±zªºµ{¦¡½X¡A¦ý½Õ¾ã¤@¤U¸g´ú¸Õ¥i¥Î±zªºÀɮפ@Áä°õ¦æ³á!!!
  1.     a.WriteLine "obje2.Application.Run """ & Chr(39) & [a1] & "a2.xlsm" & Chr(39) & "!Module1.forX"""
  2.      
  3.     For i = 15 To 19
  4.     a.WriteLine Cells(i, 1)
  5.     Next
½Æ»s¥N½X
§Ú¬O´µ¦h

TOP

¦^´_ 9# singo1232001


    ·Q¸ÕµÛ§¹¥þ¤@Áä·d©w ¦ýÁÙ¬O±Ñ¦b ¥¨¶°±Ò¥ÎªºÄµ§iµe­±

·s¼W¸ê®Æ§¨.zip (43.03 KB)

TOP

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2021-7-15 02:48 ½s¿è

¦^´_ 8# reangame

«á¨Ó§Ú¸ÕµÛ¥Îvba¦Û°Ê¥Í¦¨¤@­Ó¥þ·sªºvbs
µM«á¤SÅývba¥h°õ¦æ³o­Óvbs
¦ý¬O¥X²{¤@­Óª¬ªp
¦b§Úªº"¤U¸ü"¸ê®Æ§¨¤U ¨Ã¤£·|²£¥Í±Ò¥Î¥¨¶°ªºÄµ§i(§Y«K§Ú§ïÀɦWÅý¥L«ì´_¨ì»Ý­n±Ò¥Î¤º®eªºª¬ªp) ÁÙ¬O¥i¥H°õ¦æ
¦ý¥u­n§Ú§âÀÉ®×·hÂ÷¶}¨ì¨ä¥L¸ê®Æ§¨
´N¤@©w·|¸õ¥X ±Ò¥Î¥¨¶° Ãö³¬¥¨¶° ªº¼uµ¡
³o°ÝÃD¬Ý¨ÓÁÙ¬O¨S¿ìªk§¹¥þ¸Ñ¨M±¼

¦ý§Úµo²{¤F³o­Ó
https://ithelp.ithome.com.tw/articles/10159964

¸ò«Ü¤[¤§«e§Ú¬Ý±o³o­Ó¦³ÂI¹³
https://www.youtube.com/watch?v=G-2khNFYQl8
http://forum.twbts.com/thread-19128-1-1.html
³o­Ó¬O¥Îvbaª¦ÂÎ ¦ý·|ª¦¨ì¤@¥b¸I¨ìĵ§ialert¥d¦í ¦ý¦]¬°¨S¦³¦h½uµ{³oºØªF¦è ©Ò¥H½Ðvbs¨ÓÀ°¦£ÂI­ÓÆg!
vbaªº¹B§@ ºwµªºwµª  ºwµª¤§¶¡ ¬O¨S¿ìªk¸õ½uµ{ªº  µªºw¤§¶¡¤~¥i¥H ¦ý³q±`´N¬O¥d¦bºwµª¤§¶¡
¬Ý°_¨Ó«Ü¹³¦h½uµ{ ¦ýÁÙ¬O¥u¯à³æ½uµ{¹B¦æ ¥u¬O´«¨Ó´«¥h¶]¦Ó¤w

¦Ó³o¦¸¥L¥Î¨ìªº¦n¹³¬O©I¥svbs½ÐAutoHotKey¨ÓÀ°¦£ÂI­ÓÆg

TOP

2.rar (31.35 KB) ¦^´_ 6# singo1232001
§Ú¬O´µ¦h

TOP

¦^´_ 6# singo1232001

·PÁÂsingo1232001¤j¤j¡A
¤p§Ì¦bAÀÉ®×¥[¤JSub runVBScript()¡Aªº½T¥i¥H¹ê²{AÀÉ®×±±¨îBÀÉ®×°õ¦æ¥¨¶°¤F¡A
¤]§ä¨ì¦bAÀÉ®×VBAµ{¦¡½X±±¨îvbsÀɮתº¤èªk¡A«D±`·PÁ±z¡I
  1. Sub runVBScript()
  2.     ChDrive "C:"
  3.     ChDir "C:\Users\reang\Downloads\2"
  4.     Shell "cscript vba3.vbs"
  5. End Sub
½Æ»s¥N½X
§Ú¬O´µ¦h

TOP

¦^´_ 5# singo1232001

¥Ñ©ó¨C¥x¹q¸£ªº¦ì¸m¤£¦P
¥²¶·¥ý¿ï vba3.vbs ¥kÁä>½s¿è·í¤¤ªºa1.xlsm »Pa2.xlsm¸ô®|
§¹¦¨«áÀx¦s ¤è¥i¥¿±`°õ¦æ

Downloads.zip (25.85 KB)

TOP

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2021-7-13 10:16 ½s¿è

¦^´_ 4# reangame


¦nÃø³áQQ
https://www.youtube.com/watch?v=EGXPQs0R5YI
https://www.youtube.com/watch?v=lFSgV2gym9g

§Ú§â»`¶°ªº¨ì©Ò¦³¬ÛÃö°T®§³£¥á¤W¨Ó
http://forum.twbts.com/thread-19128-1-1.html
http://forum.twbts.com/viewthread.php?tid=2691
https://stackoverflow.com/questions/39519805/how-can-i-load-a-vba-library-reference-and-use-it-in-the-same-procedure


´ú¸Õ¤è¦¡
1.¥ý§âa1 a2¨â­ÓÀɮתºa1 ³£²M±¼ ³£¦sÀÉ Ãö³¬
2.°õ¦ævba3.vbsÀÉ®×
3.Àˬda1¬O§_5000®É¦A¥´¶}

¥t¥~¸É¥R
ÁÙ¦³3­ÓÃöÁä¦r
VBComponent
ProcOfLine
InsertLines

³o­Ó¬O§Q¥Î  VBComponent §ä¥X¥¨¶°¦s©ñªº¦ì¸m
¦³¤À¦¨¼g¤J»PŪ¨ú
¦ý«Ü½ÆÂø ­nªá®É¶¡¥h¦º¶ß¤@µf
ÃøÂI¦b©ó ¦p¦ó¤Þ¥Î ¦¨¥\
¦³ªºexcelª©¥»¯S§O¤£¬Û®e
¦³ªºª©¥»¬Æ¦Ü³sset³£¤£¥Î

³Ì«á¸É¥R¤@¤U ¤§«eªºÀÉ®×
­n§â©Ò¦³ªº:doevents ³£§R±¼ ¦]¬°·í®É§Ú¦b´ú¸Õ µ²ªG§Ñ¤F§R «Ü®e©ö½Ä¬ð

Downloads.zip (37.32 KB)

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD