五月天青色头像情侣网名,国产亚洲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)遵守國家法律
原平市| 全州县| 常州市| 衡阳县| 分宜县| 吉安县| 丰都县| 淮北市| 四会市| 永修县| 惠水县| 石景山区| 富蕴县| 迭部县| 理塘县| 河源市| 沛县| 苍山县| 磴口县| 大冶市| 吉安市| 绥阳县| 南平市| 沂水县| 荔浦县| 江川县| 灌云县| 铁岭县| 涪陵区| 伊金霍洛旗| 黄山市| 安平县| 临湘市| 门源| 海阳市| 黑龙江省| 沁水县| 浮山县| 海兴县| 都昌县| 南丰县|