五月天青色头像情侣网名,国产亚洲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)遵守國家法律
蛟河市| 丹寨县| 邵东县| 明光市| 大丰市| 施甸县| 灵石县| 哈尔滨市| 鄂州市| 花莲市| 南丹县| 朔州市| 高邮市| 温州市| 霍邱县| 明溪县| 浦城县| 万年县| 永丰县| 安义县| 唐河县| 六枝特区| 麟游县| 西充县| 沙田区| 泾川县| 遵义县| 林甸县| 宁武县| 温泉县| 万山特区| 防城港市| 安仁县| 南汇区| 抚宁县| 柞水县| 泸西县| 济南市| 阿克苏市| 汉源县| 顺昌县|