五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

局域網(wǎng)內(nèi)vba程序更新的代碼-----路徑自己改

2023-03-23 21:07 作者:積硅步志千里  | 我要投稿

Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Private Declare PtrSafe Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

Private Declare PtrSafe Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long

Sub AutoUpdate()

? ? Sheets("total").[a1].Select

? ? Dim con As New ADODB.Connection

? ? con.Open "provider=microsoft.ace.oledb.12.0;data source =C:\Users\Administrator\Desktop\net\版本號(hào).accdb"

? ? Dim sql$

? ? sql = "select 版本號(hào) from 版本號(hào)"

? ? Dim rs As New ADODB.Recordset

? ? Set rs = con.Execute(sql)

? ? Sheets("total").Range("an3").CopyFromRecordset rs

? ? rs.Close: Set rs = Nothing

? ? con.Close: Set con = Nothing

? ? If Sheets("total").[an2] <> Sheets("total").[an3] Then

? ? ? ? Sheets("total").[an3].Copy Sheets("total").[an2]

? ? ? ? MsgBox "發(fā)現(xiàn)新版本,點(diǎn)確定開始更新"

? ? ? ? On Error Resume Next

? ? ? ? Dim url As String, save_path As String, isdown As Long, fso As Object

? ? ? ? Set fso = CreateObject("Scripting.FileSystemObject")

? ?

? ? ? ? If fso.FileExists(舊版文件路徑) = True Then

? ? ? ? ? ? fso.DeleteFile 舊版文件路徑, True

? ? ? ? End If


? ? ? ? Dim folderPath As String

? ? ? ? folderPath = "C:\Users\Administrator\Desktop\Tempsave_path"

? ? ? ? If Len(Dir(folderPath, vbDirectory)) = 0 Then MkDir folderPath

? ? ? ??

? ? ? ? url = 局域網(wǎng)內(nèi)文件路徑

? ? ? ? Tempsave_path = "C:\Users\Administrator\Desktop\Tempsave_path" & "\" & fso.GetFileName(url)

? ? ? ? isdown = URLDownloadToFile(0, url, Tempsave_path, 0, 0)

? ? ? ? DeleteUrlCacheEntry (url)

? ? ? ??

? ? ? ? If Workbooks.Count = 1 Then

? ? ? ? ? ? Application.Quit

? ? ? ? End If

? ? ? ? MsgBox "更新完成!,新版在\C:\Users\Administrator\Desktop\Tempsave_path文件夾中,請(qǐng)剪切至桌面在使用!"

? ? ? ? With ThisWorkbook

? ? ? ? ? ? .Saved = True

? ? ? ? ? ? .ChangeFileAccess xlReadOnly

? ? ? ? ? ? Kill .FullName

? ? ? ? ? ? .Close

? ? ? ? End With

? ? ? ? ThisWorkbook.Close

? ? ? ? Exit Sub

? ? Else

? ? ? ? Sheets("total").[a1].Select

? ? End If

End Sub


局域網(wǎng)內(nèi)vba程序更新的代碼-----路徑自己改的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
弥勒县| 合川市| 武定县| 郸城县| 信宜市| 红原县| 揭西县| 凤山县| 瑞昌市| 沙雅县| 高陵县| 织金县| 章丘市| 彭泽县| 丹巴县| 宁蒗| 霸州市| 盐源县| 通榆县| 和田市| 奉新县| 鄯善县| 沧源| 岫岩| 新疆| 额尔古纳市| 凤翔县| 尉犁县| 上犹县| 都匀市| 民丰县| 临西县| 遵义县| 平安县| 阜康市| 道孚县| 淮滨县| 海城市| 富源县| 夏津县| 渑池县|