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

[µo°Ý] Ãö©ó¹Ï¤ùVBAªº°ÝÃD

[µo°Ý] Ãö©ó¹Ï¤ùVBAªº°ÝÃD

¥»©«³Ì«á¥Ñ av8d ©ó 2012-2-2 11:32 ½s¿è

§Ú¶}±Ò¤F¨â±i¹Ï¤ùVBA~¤À§O¬OImage1©MImage2

§Ú§Æ±æ§ÚÂI¤@¤UImage1±N·|¶]´¡¤J¹Ï¤ùªº¨º­Óµøµ¡¡A
¹w³]¸ô®|¬O®à­±¡AµM«á¯àÅý§Ú¿ï¨ú¡A¥i¬O¤£ª¾¹D¸Ì­±¸Ó«ç»ò¼g
Private Sub Image1_Click()

End Sub

µM«á¼g­Ó¥¨¶°¥h§R°£Image1ªº¹Ï¤ù¡A¦ý¬O¤º®e¦³¿ù
Sub ColseImage_Click()
Image1.Picture = (µL)
End Sub

µM«á¼g­Ó¥¨¶°¥h§R°£¥þ³¡ªº¹Ï¤ùVBA¡A¦ý¬O¤º®e¦³¿ù
Sub ColseImage_Click()
Image1.Picture = (µL)
Image2.Picture = (µL)
End Sub

¹Ï¤ùVBA¤ºªºHeight©MWidth¤ºªº¼Æ­È³æ¦ì¬O?¤½¤ÀÁÙ¬O?

¦^´_ 1# av8d
  1. Option Explicit
  2. Private Sub Image1_Click()
  3.     With Application.FileDialog(msoFileDialogFilePicker)
  4.         .InitialFileName = "D:\*.*"    '­×§ï¬°§Aªº®à­±¸ô®|
  5.         If .Show = -1 Then Image1.Picture = LoadPicture(.SelectedItems(1))
  6.     End With
  7. End Sub
½Æ»s¥N½X

§R°£Image1ªº¹Ï¤ù   Image1.Picture = LoadPicture("")
VBAªº»¡©ú:
Height¡BWidth ÄÝ©Ê ª«¥óªº°ª«×»P¼e«×¡A³æ¦ì¬°ÂI¡C
ÂI¼Æ ¤@ÂI¬° 1/72 ¦T¡C¦r§Î¤j¤p³q±`¥HÂI¼Æ¨Ó¶q«×
Height ©Î Width ¥²¶·¤j©óµ¥©ó¹s¡C¦b¦h¼Æ¨t²Î¤¤¡A³q±`¨ä½d³ò¦b 0 ¨ì +32,767 ¤§¶¡¡A¶W¹Lªº¸Ü«h»Ýµø¨t²Î¦Ó©w¡C

TOP

¦L¶H¤W¤@³æ¦ì¬°µøµ¡§¤¼Ð1³æ¦ìªºªø«×

TOP

¦^´_ 2# GBKEE


    §R°£Image1ªº¹Ï¤ù   Image1.Picture = LoadPicture("")

±z¦n~¦pªG§Ú¬O¶}±Òµe¤@­Ó¶ê§Î~µM«á¥kÁä¡÷«ü©w¥¨¶°

·|¥X²{¦¹³B»Ý­nª«¥ó (¿ù»~ 424)

Dim RetVal                                ' ¬°¤@ Variant¡C
' ¹w³]ÄÝ©Ê«ü©w¬°«¬ºA 8¡A§Y Variant RetVal¡C
RetVal = CreateObject("Excel.Application")   
RetVal.Visible = True                ' ¿ù»~¦b¦¹µo¥Í¡C

·í«ü©wª«¥ó¤Þ¥Î®É¡A½Ð¨Ï¥Î Set ³¯­z¦¡¡C

©Ò¥H¦pªG¬O¥Î«ü©w¥¨¶°ªº¼gªk¤£¦Pªº¦a¤è¬O? ¦A¦¸·PÁ¡C

TOP

¦^´_ 4# av8d
±z¦n~¦pªG§Ú¬O¶}±Òµe¤@­Ó¶ê§Î~µM«á¥kÁä¡÷«ü©w¥¨¶°
¿ý»s:
  1. Sub Macro1()
  2.     ActiveSheet.Shapes("AutoShape 1").Select
  3.     Selection.OnAction = "ThisWorkbook.EX"
  4. End Sub
½Æ»s¥N½X

¦Û¤v¼gªº
  1. Sub EX()
  2.     Sheet1.Shapes("AutoShape 1").OnAction = "ThisWorkbook.EX"
  3. End Sub
½Æ»s¥N½X

***************************
Dim RetVal                                ' ¬°¤@ Variant¡C
' ¹w³]ÄÝ©Ê«ü©w¬°«¬ºA 8¡A§Y Variant RetVal¡C
RetVal = CreateObject("Excel.Application")   
RetVal.Visible = True                ' ¿ù»~¦b¦¹µo¥Í¡C
·í«ü©wª«¥ó¤Þ¥Î®É¡A½Ð¨Ï¥Î Set ³¯­z¦¡¡C
*********³o¤@¬q¤£©úÁA   §A¤wª¾¹D  ½Ð¨Ï¥Î Set ³¯­z¦¡

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-2-4 11:54 ½s¿è

¦^´_ 5# GBKEE

¦pªG§Ú¬O¼g¦b¾ò¶ê32¸Ì­±¸Ó¦p¦ó®M¥Î©O?¦]¬°·|¥X²{  "¨t²Î¿ù»~&H80070057(-2147024809)"  

ÂI¤F¤@¤U»¡©ú¥X²{

²£¥Í«ü©w¨t²Î¿ù»~
Visual Basic ¹J¨ì¤@­Ó¥Ñ¨t²Î©Î¥~³¡¤¸¥ó©Ò²£¥Íªº¿ù»~¡C

    Sub ¾ò¶ê32_Click()

    End Sub
¦pªG­n¤@¦¸§R°£¥þ³¡ªº¹Ï¤ùVBA¼gªk¬O§_¦³¤ñ¸û²©öªº¤èªk©O?

ÁÂ~ÁÂ~¤j~¤j

TOP

¦^´_ 6# av8d
ªþ¤WÀɮ׬ݬÝ
  1. Sub Ex()
  2.     ActiveSheet.Pictures.Delete   '§R°£¥þ³¡·Ó¤ù
  3.     ''''''''''''''''''''''''''''''''''''''''''
  4.     ActiveSheet.Shapes.SelectAll  'ÂI¿ï¥þ³¡¹Ï¤ù
  5.     Selection.Delete              '§R°£ ÂI¿ï¥þ³¡¹Ï¤ù
  6. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-2-4 13:01 ½s¿è

¦^´_ 7# GBKEE


    123.rar (174.85 KB)

§Ú­è´ú¸Õ¤F¤@¤U~³£¥i¥H¤F~
Image1.Picture = LoadPicture("")

§R°£¥þ³¡´N­n½Æ»s¶K¤W10¦¸¤F
Image1.Picture = LoadPicture("")
Image2.Picture = LoadPicture("")
...
..
.
.

ÁÂÁª©¥D~±z¨¯­W¤F~À³¸Ó³£ÁÙ¨S¦Y¶º§a~¦A¦¸·PÁÂ!

TOP

¦^´_ 8# av8d
Sheet1 ¨S¦³¾ò¶ê 32
Sub ¾ò¶ê32_Click()
    Sheet3.Shapes("¾ò¶ê 32").OnAction = "ThisWorkbook.EX"
End Sub

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD