- ©«¤l
- 154
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 200
- ÂI¦W
- 28
- §@·~¨t²Î
- windwos 7
- ³nÅ骩¥»
- 64bit
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2017-5-29
- ³Ì«áµn¿ý
- 2024-10-22
|
¥»©«³Ì«á¥Ñ quickfixer ©ó 2019-3-15 04:18 ½s¿è
¦^´_ 16# 502243
§Anªº¤£¬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- Sub test()
- Dim app1 As Object, book1 As Excel.Workbook
- Set app1 = CreateObject("Excel.Application")
- Set book1 = app1.Workbooks.Open(ThisWorkbook.Path & "\" & "2.xlsm")
- app1.Visible = True
-
- Dim sourcedata As Range, targetdata As Range, temp() As Variant
- Set sourcedata = Sheets("a").Range("a1:a5")
- Set targetdata = book1.Sheets("b").Range("a1:a5")
- temp = sourcedata
- targetdata.Value = temp
-
- app1.Run "test"
-
- Set sourcedata = book1.Sheets("b").Range("b1:b5")
- Set targetdata = Sheets("a").Range("c1:c5")
- temp = sourcedata
- targetdata.Value = temp
-
- book1.Close SaveChanges:=False
- app1.Quit
- Set app1 = Nothing
- Set book1 = Nothing
-
-
- End Sub
½Æ»s¥N½X 2.xlsm- Sub test()
-
- For i = 1 To 5
- Sheets("b").Cells(i, 2) = Sheets("b").Cells(i, 1) + Rnd()
- Next i
-
- End Sub
½Æ»s¥N½X
excel.zip (24.51 KB)
|
|