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

[µo°Ý] ¨â­Ó¿W¥ßEXCEL ¦p¦ó±N¹Bºâ§¹ªº¸ê®Æ¦^¶Ç¨ì¥DExcel?

[µo°Ý] ¨â­Ó¿W¥ßEXCEL ¦p¦ó±N¹Bºâ§¹ªº¸ê®Æ¦^¶Ç¨ì¥DExcel?

¦U¦ì«e½ú­Ì¤j®a¦n¡A
ºÃ°Ýµo¥Í¦p¤U¡G
·f°t¤U¹Ï
1.¶}©l¶s¸ò°±¤î¶s³£¦bA.xlsm¸Ì..·s¶}±Ò¤@­Ó¿W¥ßªºexcel¥N½X¦p¤U..¦ý´N¨S¿ìªk¤Þ¥Î¬ÛÃö·sª«¥óexcelªºÄÝ©Ê»P¤èªk

¥N½X­n¦p¦ó¼g¤~¯à¤Þ¥Î±±¨îexcel2.exe©O¡K.

Sub newexcel()
Dim xlapp As Object
Dim xlbook As Object

        Set xlapp = CreateObject("Excel.Application")
       Set xlbook = xlapp.Workbooks.Open("D:\Excel VBA\A.xlsm")

¡¥³oÃä¯à§_CALL  °Æµ{¦¡?      

        xlapp.Workbooks(¡§A¡¨).Close SaveChanges:=False ¡¥
        xlapp.Quit
        
      '  Set xlbook = Nothing
      '  Set xlapp = Nothing
End Sub
ª¦¤å§ä¤F«Ü¤[..¥u§ä¨ì«Ü¦h¹p¦P¤W­±¤@¬q..
ÁٽФj¤j«üÂI¤@¤U¡K.

¦^´_ 22# quickfixer

·PÁÂquickfixer¤j..¤@»yÅå¿ô¹Ú¤¤¤H..
ÁÙ¦b·Q»¡«ç»ò©î¤À...
²{¦b¤w¸g¶¶§Q±N«Ø¦¨ª«¥ó..©MAÀÉcopy¨ìCÀÉ..CÀÉcopy¦^AÀÉ ..¤À¦¨3­Ó°Æµ{¦¡®Ø¬[
³Ñ¤U¦A§â¨ä¾lªº°Æµ{¦¡¥[¤J¨ä¤¤...
½Õ¾ã¤@¨Ç¬yµ{¨BÆJ..

·PÁ¦^À³³o½g¥DÃDªº¦U¦ì«e½úÂI¿ô...

TOP

Sub readData()

'数Õu读¨ú
'----------------------------------------------
    Dim dataExcel, Workbook, sheet
    Dim totalRow  As Integer
    Set dataExcel = CreateObject("Excel.Application")
    Set Workbook = dataExcel.Workbooks.Open("E:\­n读¨ú数Õuªº·½¤å¥ó.xlsx")
    Set sheet = Workbook.Worksheets(1)     '读¨ú²Ä¤@个sheet页ªº数Õu
    totalRow = sheet.UsedRange.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row
    For i = 2 To totalRow
         
         Sheets("sheet1").Cells(i, 3) = sheet.Cells(i, 4)
        
    Next i
    Workbook.Close
    MsgBox "读¨ú¦¨¥\¡I", vbSystemModal '读¨ú§¹¦Z弹®Ø´£¿ô
'----------------------------------------------
End Sub

TOP

¦^´_ 20# 502243


    dim §ï public,¹³ gbkee  #16 ¨º¹³¼g,´N¥i¥H§âÃö³¬©ñ¨ì¥t¤@­Ósub
Public app1 As Object, book1 As Excel.Workbook

TOP

¦^´_ 17# quickfixer


    ÁÂÁÂÂI©ú¤F application.run  --> app1.Run "test"

TOP

¥»©«³Ì«á¥Ñ 502243 ©ó 2019-3-15 08:43 ½s¿è

¦^´_ 18# GBKEE
  1.   '¤@¯ë Module ªºµ{¦¡½X
  2. Option Explicit
  3.     Public Ap As Object, Aa As Object
  4.    Sub Ex_¶}©l( )
  5.          '·s¶}2­ÓExcel µ{¦¡
  6.          Set Ap = New Application
  7.           Set Aa = New Application
  8.             Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  9.              Ap.Visible = True
  10.             Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  11.              Aa.Visible = True
  12.       '  Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý         
  13.     End Sub

  14.      Sub Ex_µ²§ô( )
  15.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  16.           Ap.Quit
  17.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  18.           Aa.Qui
  19.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  20.     End Sub

  21.     Sub test( )
  22.         Dim app1 As Object, book1 As Excel.Workbook
  23.         Set app1 = CreateObject("Excel.Application")
  24.         app1.Visible = True                 
  25.         app1.Quit
  26.         Set app1 = Nothing
  27.     End Sub
½Æ»s¥N½X
­è¸Õ¤F¤@¤U test¥i¥H§¹¥þÃö³¬·s«Ø¥ßexcel.exe  »P¤W­±ªº®t²§ ¦h¤F¤@­Óset app1=Nothing
©Ò¥H·s«Øexcelª«¥ó   «Ø¥ß»PÃö³¬¤£¯à©î¤À¦¨¨â­Ó°Æµ{¦¡?
®¦...§Ú¦b¦h¸Õ´X­Ó¬Ý¬Ý

TOP

¦^´_ 17# quickfixer


    ·PÁÂquickfixer¤j¤jªº¸ê®Æ°Ñ¦Ò
   ªº½T¬O¨â­Ó¤£¦Pªºexcel.exe¸ê®Æ¤¬¶Ç....
    ­ì¨Ó¬O­n§Q¥Îset ¥[¤W½w½Ä°Ï...
   ©¡®É§Ú·|°Ñ¦Ò«e½ú­Ìªº¼Ò«¬°òªO¤U¥h°µ­×§ï½Õ¾ã.....
   ¸U¤À·PÁÂ~

TOP

¦^´_ 16# 502243
    '¤@¯ë Module ªºµ{¦¡½X
  1.     Option Explicit
  2.     Public Ap As Object, Aa As Object
  3.    Sub Ex_¶}©l()
  4.          '·s¶}2­ÓExcel µ{¦¡
  5.          Set Ap = New Application
  6.         Set Aa = New Application
  7.          Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  8.         Ap.Visible = True
  9.        Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  10.         Aa.Visible = True
  11.         Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  12.          
  13.     End Sub
  14.      Sub Ex_µ²§ô()
  15.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  16.           Ap.Quit
  17.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  18.           Aa.Quit
  19.           Stop '¶}±Ò¤u§@ºÞ²z­û¬Ý¬Ý
  20.     End Sub
  21.    
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2019-3-15 04:18 ½s¿è

¦^´_ 16# 502243

§A­nªº¤£¬O¦P¤@­Óexcel¶}2­ÓÀɤ¬¶Ç,¦Ó¬O2­Ó¤£¦Pexcel.exe¤¬¶Ç¸ê®Æ,¹ï¶Ü?

°Ñ¦Ò¸ê®Æ¨Ó·½
https://www.mobile01.com/topicdetail.php?f=511&t=4737630&p=1
(#244f)
§Ú¸Õ¹L¤u§@ºÞ²z­û¤£·|´Ý¦sexcel.exe
1.xlsm
  1. Sub test()

  2.     Dim app1 As Object, book1 As Excel.Workbook
  3.     Set app1 = CreateObject("Excel.Application")
  4.     Set book1 = app1.Workbooks.Open(ThisWorkbook.Path & "\" & "2.xlsm")
  5.     app1.Visible = True
  6.    
  7.     Dim sourcedata As Range, targetdata As Range, temp() As Variant
  8.     Set sourcedata = Sheets("a").Range("a1:a5")
  9.     Set targetdata = book1.Sheets("b").Range("a1:a5")
  10.     temp = sourcedata
  11.     targetdata.Value = temp
  12.    
  13.     app1.Run "test"
  14.    
  15.     Set sourcedata = book1.Sheets("b").Range("b1:b5")
  16.     Set targetdata = Sheets("a").Range("c1:c5")
  17.     temp = sourcedata
  18.     targetdata.Value = temp
  19.    
  20.     book1.Close SaveChanges:=False
  21.     app1.Quit
  22.     Set app1 = Nothing
  23.     Set book1 = Nothing
  24.    

  25. End Sub
½Æ»s¥N½X
2.xlsm
  1. Sub test()
  2.    
  3.     For i = 1 To 5
  4.         Sheets("b").Cells(i, 2) = Sheets("b").Cells(i, 1) + Rnd()
  5.     Next i
  6.    
  7. End Sub
½Æ»s¥N½X
excel.zip (24.51 KB)

TOP

¦^´_ 15# GBKEE

·PÁÂGBKEEª©¥D¤j¤jªºÀ°§U..
    ¥Ø«e«ö·Óª©¤jªº¼Ë¥»¤j²¤­×§ï¤F¤@¤U..¦p¤UªþÀÉ Excel VBA.zip (51.75 KB)
    ¥t¥~·|´Â ¤£¦Pexcel.exe  ¶¡ ªºª«¥ó ±±¨îÃöÁä¦r¦b¤U¥h·j´M¬ÛÃö»y¥y
      Ap.Quit    <==³o«ü¥O¥Î¦bexcel.exeª«¥ó¸Ì­± ¥i¥HÅýªí­±µ{¦¡¬Ý°_¨Ó¤£¨£  «o·|´Ý¦sexcel.exe
    ¾É­P¦pªG±j¨î±q  ¤u§@ºÞ²z­ûÃö³¬ªº¸Ü  ¦A¦¸±Ò°Ê  Sub Ex_¶}©l( )·|²£¥Í"462"¿ù»~   <==¿ù»~µo¥Íªº­ì¦]«Ü¦h
   
001.png
   ¤£¹Lµ¹ªº¤è¦VÁÙ¬OÀ°§U«Ü¤j....«Ü·PÁÂ.....(²¦³º¤p§Ì¬ã¨s¤F¤@­Ó§«ô³£§ä¤£¨ì¤è¦V..¤ß²zºw©BµÛ)

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¯Ê¤fªºªM¤l¡A¦pªG´«¤@­Ó¨¤«×¬Ý¥¦¡A¥¦¤´µM¬O¶êªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD