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

±qWord¤å¥ó¤¤ªºªí®æ¸ê®ÆÂಾ¦ÜExcel

±qWord¤å¥ó¤¤ªºªí®æ¸ê®ÆÂಾ¦ÜExcel

³o­Óµ{¦¡¬O¦b³Â»¶½×¾Âcopy¥X¨Óªº
  1. Sub copyfromword()
  2. Dim wordapplication As Word.Application, worddocument As Object
  3. Dim r, c As Integer
  4. Set wordapplication = CreateObject("word.application")
  5. Set worddocument = wordapplication.Documents.Open(ThisWorkbook.Path & "\myword.doc")
  6. With worddocument.Tables(1)
  7. For r = 1 To .Rows.Count
  8. For c = 1 To .Columns.Count
  9. Cells(r, c) = .Cell(r, c)
  10. Next c
  11. Next r
  12. End With
  13. worddocument.Close
  14. wordapplication.Quit
  15. Set wordapplication = Nothing
  16. Set worddocument = Nothing
  17. End Sub
½Æ»s¥N½X
Set wordapplication = CreateObject("word.application") ³o¦æ¥X²{Error 13«¬ºA¤£²Å¦Xªº¿ù»~«ü¥Ü
À³«ç¼Ë¸Ñ¨M
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 1# FAlonso


   
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¿ï¾Ü¤Fword library,ÁÙ¬O¦Ñ¼Ë¤l. ¤£ª¾¦ó¸Ñ?
¦¹Àɮשñ¦b¹q¸£¤@°}¤l,©~µM¦Û¤v¤]§Ñ¤F¦p¦ó¸Ñ¨M
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 3# FAlonso
§Ú´ú¸Õ¹Lµ²ªG¬O¥¿±`ªº³á,
¥t¥~¦³¤@¦æ«Øij­×¥¿¤@¤U :
Set worddocument = wordapplication.Documents.Open(Chr(34) & ThisWorkbook.Path & Chr(34) & "\myword.doc")
¨ä¤@ ­ì¦¡¦ü¥G¤Ö¤@­Ó &
¨ä¤G ­ì¦¡­Y©ó¸ÓÀɮ׬O©ñ¦b½Ñ¦p "§Úªº¤å¥ó" ³oÃþ¥Ø¿ý¤¤¶¡¦³ ªÅ®æ ªº±¡§Î®É·|§ä¤£¨ì¨º­ÓWordÀÉ.

TOP

§Ú¦bdeclare¤¤§R¤Fword.application´N¦æ¤F,¦hÁ¦U¦ì¸Ñµª
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD