[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

learn-ruby-in-kansai:132

From: Nobuyuki-Sakai <sakai-n@m...>
Date: Sat, 25 Dec 2004 21:38:53 +0900
Subject: [learn-ruby-in-kansai:132] Re: WIN32OLE ¤Ë¤Ä¤¤¤Æ¤Î¼ÁÌ䣲

¼ò°æ¤Ç¤¹¡£

cuzic¤µ¤ó¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£¡¡¤ª¤«¤²¤Ç­¡¤Ï²ò·è¤·¤Þ¤·¤¿¡£
cell.item(i, j).Borders(position('l')).Weight = line_w('s')¤¬
cell[i, j].Borders(position('l')).Weight = line_w('s')¤Èµ­½Ò¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê 
¤Þ¤·¤¿¡£

¤·¤«¤·¡¢moduleÄêµÁ¤ÎÃæ¤Îdef v.cell= cell¤Èdef v.method_missing(name,*args)
¤Î°ÕÌ£¤¬Íý²ò¤Ç¤­¤Þ¤»¤ó¡£ÊÙ¶¯²ñ¤Ç¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
 >module Worksheet
 >  def [] y,x
 >    cell = self.Cells.Item(y,x)
 >    v = cell.Value
 >    def v.cell= cell¡¡¡¡¡ôÍý²ò¤Ç¤­¤Þ¤»¤ó
 >      @cell = cell
 >    end
 >    v.cell = cell
 >    def v.method_missing(name,*args)¡¡¡¡¡ôÍý²ò¤Ç¤­¤Þ¤»¤ó
 >      @cell.__send__(name,*args)
 >    end
 >    return v
 >  end
 >end
 >¥Ý¥¤¥ó¥È¤Ï method_missing ¤ò»È¤¦¤³¤È¤Ç¡¢cell ¤Ëdelegate ¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¤
¤ëÅÀ¤Ç¤¹¡£

 >»ä¤¬¤¿¤È¤¨¤Ð¥é¥¤¥Ö¥é¥êºîÀ®¤Î¤è¤¦¤ÊÊýË¡¤Ç¤Ï¤Ê¤¯¡¢Win32OLE¤Îµ­»ö¤ò½ñ¤¯
 >¤È¤¤¤¦·Á¤Ç»ä¤¬ÆÀ¤Æ¤¤¤ëÃ諤òÌòΩ¤Æ¤è¤¦¤È»×¤Ã¤¿¤Î¤Ë¤ÏÍýͳ¤¬¤¢¤ê¤Þ¤¹¡£
 >¤½¤ì¤Ï¡¢Æɤó¤À¿Í¤¬¤½¤ì¤¾¤ì¼«Ê¬¤Î¤ä¤êÊý¤ò¤·¤Æ¤¤¤Ã¤Æ¤â¤é¤¦¤¿¤á¤Ç¤¹¡£
 >¼«Ê¬¤Ê¤ê¤Î¤ä¤êÊý¤Ç¤ä¤Ã¤Æ¤¤¤Ã¤Æ¤â¤é¤¨¤ë¤È¤¦¤ì¤·¤¤¤Ç¤¹¡£

¤Ê¤«¤Ê¤«»²¹Í¤Ë¤Ç¤­¤ëÎ㤬VBA¤·¤«¤Ê¤¯Ruby¤é¤·¤¯Win32OLE¤ÇEXCEL¤ò»È¤¦¤³¤È¤Ï¡¢Æñ 
¤·¤¤¡£
VBA¤ÎÎãÂê¤Ï¡¢¤À¤é¤À¤éµ¡Ç½¤ò¾Ò²ðµ­½Ò¤¹¤ëÎ㤬¿¤¤¤Î¤ÈRuby¤ÎOOP¤ËÂФ¹¤ëÃμ±ÉÔ­ 
¤â¸¶°ø¤Î£±¤Ä¤Ç¤¹¡£

 >´Êñ¤Ë»È¤¦¤È¤¤¤¦¤³¤È¤ò½Å»ë¤¹¤ë¤È¡¢¥é¥Ã¥Ñ¡¼¥¯¥é¥¹¤òÍÑ°Õ¤¹¤ë¤Î¤¬Îɤ¤¤Ç¤·¤ç¤¦¤Í¡£

EXCELÍѤΥé¥Ã¥Ñ¡¼¥¯¥é¥¹¤òºî¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤Ë¤Ï¡¢¤â¤¦¾¯¤·»þ´Ö¤ÈÃ챤¬É¬ÍפǤ¹¡£

­¢¤Ë¤Ä¤¤¤Æ¤Ï¡¢¹Í¤¨Ãæ¤Ç¤¹¡£Ê£¿ô¤ÎBook¤Îsheet¤ò»È¤¦¾ì¹ç¤Î´Ö°ã¤¤¤Ç¤·¤¿¡£
¿·µ¬¤Îbook¡¢Sheet̾¡¢Sheet¤Î¸å½èÍý¤Ê¤É¤½¤ì¤¾¤ì°Û¤Ê¤ë¾ì¹ç¤Ë¤âŬÍѤǤ­¤ë¤è¤¦¤Ë 
¹Í¤¨¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£

 >»²¹Í¤Ë¤·¤Þ¤¹¤Î¤Ç¡¢¤É¤Î¥Æ¥¯¥Ë¥Ã¥¯¤¬ÃΤé¤Ê¤«¤Ã¤¿¤Î¤«¤È¤«¡¢¤³¤ì¤Ï»È¤¨¤ë¡ª¤È
 >»×¤Ã¤¿¥Æ¥¯¥Ë¥Ã¥¯¤Ë¤É¤ó¤Ê¤â¤Î¤¬¤¢¤Ã¤¿¤Î¤«¤â¶µ¤¨¤ÆÍߤ·¤¤¤Ç¤¹¡£
Ruby¤Ï¡¢Class¤ämodule¤òºîÀ®¤·¤Ê¤¯¤Æ¤â¥×¥í¥°¥é¥à¤Ç¤­¤Æ¤·¤Þ¤¦¤¿¤á»È¤Ã¤Æ¼«Ê¬¤Ç 
¤Ï¡¢ºî¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
£±.module¤Ë¤è¤ë³ÈÄ¥¡£¡¡module¤Ï¡¢Class¤Ëinclude¤·¤Æ»È¤¦¤â¤Î¤È»×¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
£².. £ù£é£å£ì£ä¤Î»È¤¤Êý¡£¡¡ ¡¡£ù£é£å£ì£ä¤Ë¤Ä¤¤¤Æ¤Ï¡¢ËܤòÆɤó¤Ç¤âº££±¤Ä»È¤¤¾ì 
½ê¤¬ÉÔÌÀ¤Ç¤·¤¿¡£

¤Ç¤â¡¢Win32OLE¤Ç»È¤¦¤Ë¤ÏEXCEL¤¬°ìÈֻȤ¤Æ»¤¬¤¢¤ë¤è¤¦¤Ë»×¤¤¤Þ¤¹¡£
¤è¤¤¥¯¥ê¥¹¥Þ¥¹¥×¥ì¥¼¥ó¥È¤Ë¤Ê¤ê¤Þ¤·¤¿¡£


º£¸å¤È¤â¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£ 


--
ML: learn-ruby-in-kansai@r...
»È¤¤Êý: http://QuickML.com/

[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

->     132 2004-12-25 13:38 [sakai-n@m...        ] Re: WIN32OLE ¤Ë¤Ä¤¤¤Æ¤Î¼ÁÌ䣲           
       137 2004-12-26 12:56 ¨±[tomoya@c...         ]