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

±qºô¸ôµwºÐ¤U¸üexcelÀɦܮୱ «oµLªk¥¿±`¶}±ÒÀÉ®×

±qºô¸ôµwºÐ¤U¸üexcelÀɦܮୱ «oµLªk¥¿±`¶}±ÒÀÉ®×

¥»©«³Ì«á¥Ñ justintoolbox ©ó 2015-6-26 11:22 ½s¿è

¦U¦ì«e½ú­Ì¤j®a¦n¡A¤p§Ì·Q±q¦Û¤vªººô¸ôµwºÐ¤U¸üEXCELÀɦܮୱ¡C
¥Ø«e¹J¨ìªº°ÝÃD¬O¡G¤U¸üªºÀɮ׬O¿ù»~ªºµLªk¶}±Ò¡A¦p¤U¹Ï


¤£ª¾¹D¸Ó­þ¸Ì¥X¤F°ÝÃD¡A¦A½Ð¦U¦ì«e½ú«ü¾É¡A·PÁ¡I
  1. Option Explicit

  2. Sub DownloadXLFileFromURL()

  3.      Dim myURL As String, sFilename As String
  4.      myURL = "https://drive.google.com/open?id=0B3PmLEYBktf4MENuMXZOcW9BN2M"
  5.      sFilename = Environ("SystemDrive") & Environ("HomePath") & _
  6.              Application.PathSeparator & "Desktop" & Application.PathSeparator & _
  7.              "file.xlsx"
  8.    
  9.      Dim WinHttpReq As Object, oStream As Object
  10.      Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
  11.      WinHttpReq.Open "GET", myURL, False ', "username", "password"
  12.     WinHttpReq.Send
  13.    
  14.      myURL = WinHttpReq.ResponseBody
  15.      If WinHttpReq.Status = 200 Then
  16.          Set oStream = CreateObject("ADODB.Stream")
  17.          oStream.Open
  18.          oStream.Type = 1
  19.          oStream.Write WinHttpReq.ResponseBody
  20.          oStream.SaveToFile sFilename, 2  ' 1 = no overwrite, 2 = overwrite
  21.         oStream.Close
  22.      End If

  23. End Sub
½Æ»s¥N½X

¦U¦ì«e½ú­Ì¤j®a¦n¡A¤p§Ì·Q±q¦Û¤vªººô¸ôµwºÐ¤U¸üEXCELÀɦܮୱ¡C
¥Ø«e¹J¨ìªº°ÝÃD¬O¡G¤U¸üªºÀɮ׬O¿ù»~ªºµLªk ...
justintoolbox µoªí©ó 2015-6-26 11:21



¦U¦ì«e½ú­Ì©Î°ª¤â­Ì¡I¯à§_«üÂI°g¬z¤@¤U¡I«ô°U¤F¡I·P®¦¡I

TOP

¨S¦³±b¸¹±K½X¨Sªk¤l´ú¸Õ°Ú

TOP

¨S¦³±b¸¹±K½X¨Sªk¤l´ú¸Õ°Ú
jackyq µoªí©ó 2015-6-27 12:20


Jackyq§A¦n¡A®¤µLªk´£¨Ñ±b¸¹±K½X¡C¦ý¬O§Ú¦³¦bVBA¤º¶ñ¤W±b¸¹»P±K½X¤@¼Ë¬OµLªk¨Ï¥Î¡C
¥t¤@ÂI¤£ª¾¤°»ò­ì¦]¡G­Y¹q¸£¤º¦³¦w¸Ëgoogledrive «h¥i¥H¤U¸üÀɮסA¦ýµLªk¥´¶}excelÀÉ
­Y¹q¸£¤ºµL¦w¸Ëgoogledrive«hµ{¦¡°õ¦æ¨ìWinHttpReq.Send ´N·|¦³¿ù»~¡I¡]³o³¡¤À§Ú³£¦³§â±b¸¹»P±K½X³£¶ñ¤J¤F¡I¡^

·Q»¡½Ð°Ý¦U¦ì°ª¤â¡A¦pªGºJ¶}¤p§Ì´£¨Ñªº¥N½X¡A
¦pªG§Ú·Q­n¤U¸ü¡Ghttps://drive.google.com/uc?export=download&id=0B3PmLEYBktf4MENuMXZOcW9BN2M
¸Ó«ç»ò¼¶¼g¡H¦A¦¸Àµ½Ð¦U¦ì°ª¤â«üÂI¡I«ô°U¤F¡I¡I¡I¡I¡I

TOP

¦^´_ 4# justintoolbox

§A»¡­Y¹q¸£¤º¦³¦w¸Ëgoogledrive «h¥i¥H¤U¸üÀɮסA¦ýµLªk¥´¶}excelÀÉ
¨º½Ð§A§â§A»¡ªº¨º­ÓµLªk¥´¶}ªºexcelÀÉ
¤W¶Çµ¹¤j®a¸Õ¸Õ¬Ý¯à¤£¯à¥´¶}
¦pªG§Ú­Ì¤]¤£¯à¥´¶}
¬O§_¥iªí¥Ü§A¥Î VBA ¤U¸üªºexcelÀɬO­Ó·l·´ªºÀÉ®×
³o¼Ë¦Ü¤Ö¥i¥H¥ýÂo±¼¤@¨Ç¥i¯à©Ê

TOP

¦^´_ 4# justintoolbox

·Q»¡½Ð°Ý¦U¦ì°ª¤â¡A¦pªGºJ¶}¤p§Ì´£¨Ñªº¥N½X¡A
¦pªG±qºô¸ôµwºÐ¤U¸ü³sµ²¬°¥H¤U¡G¡]¤£»Ý­n±b¸¹»P±K½X¡^
https://drive.google.com/uc?export=download&id=0B3PmLEYBktf4MENuMXZOcW9BN2M
¸Ó«ç»ò¼¶¼gVBA¡H
ºô¸ô¤U¸ü³o¤è­±¤p§Ì¯uªº«Ü¤£À´¡C
¦A¦¸Àµ½Ð¦U¦ì°ª¤â«üÂI¡C

«ô°U¤F

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-6-28 11:43 ½s¿è

¦^´_ 6# justintoolbox

¤U¸ü«áªºÀɮר䣬O.xlsxÀÉ¡A¦Ó¬O.htmlÀÉ¡A¦ý§A¦sªº°ÆÀɦW¬°.xlsx©Ò¥HExcel»~¥H¬°¬O·lÃaªºÀɮסA¨ä¹ê¬O.htmlÀÉ
  ¨ä¹ê§Ú¤]¤£·|¡A§Ú¥u¬O·ÓµÛ§A­ìµ{¦¡¤Î¤èªk¥h°µ¡A¦Óµo²{ªº



TOP

¦U¦ì«e½ú­Ì¤j®a¦n¡A¤p§Ì·Q±q¦Û¤vªººô¸ôµwºÐ¤U¸üEXCELÀɦܮୱ¡C
¥Ø«e¹J¨ìªº°ÝÃD¬O¡G¤U¸üªºÀɮ׬O¿ù»~ªºµLªk ...
justintoolbox µoªí©ó 2015-6-26 11:21



    "file.xlsx"
³o­Ó¤À¶}¼g ¸Õ¸Õ¬Ý~

"file" & ".xlsx"

©Î§ï¦s
"file" & ".xls"

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 8# mark15jill
lpk187 : ÁÂÁ§AÀ°§Ú´ú¸Õ ¡CÁöµMÁÙ¨S¦³¸Ñ¨M¤èªk¡A¤£¹LÁÙ¬O«ÜÁÂÁ§A´£¨Ñ¤@¨Ç°T®§¡C
mark15jill :ÁÂÁ§A´£¨Ñ§Aªº¤@¨Ç«Øij ¡A§Ú­è­è¤]¸Õ¹L¤F¡C¥u¬OÁÙ¬O¤@¼Ë¨ì¤F"WinHttpReq.Send"´N¥X²{¿ù»~°T®§ ¡C

¨ä¥Lªº°ª¤â¤£ª¾¹D¯à§_´£¨Ñ¸Ñ¨M¤è®×¡A«ô°U¤F ¡ã

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD