@@ -10,12 +10,15 @@ MsgBox "Before updating the add-in file, the add-in must not be loaded!" & chr(1
1010Select Case MsgBox( "Should the add-in be used as a compiled file (accde)?" + chr( 13 ) & _
1111 "(Add-In is compiled and copied to the Add-In directory.)" , 3 , MsgBoxTitle)
1212 case 6 ' vbYes
13- AddInFileInstalled = CreateMde(GetSourceFileFullName, GetDestFileFullName)
13+ tempAccdb = GetDestFileFullName & ".accdb"
14+ FileCopy GetSourceFileFullName, tempAccdb
15+ AddInFileInstalled = CreateMde(tempAccdb, GetDestFileFullName)
1416 If AddInFileInstalled Then
1517 CompletedMsg = "Add-In was compiled and saved in '" + GetAddInLocation + "'."
1618 Else
1719 CompletedMsg = "Error! Compiled file was not created."
1820 End If
21+ DeleteFile tempAccdb
1922 case 7 ' vbNo
2023 AddInFileInstalled = FileCopy(GetSourceFileFullName, GetDestFileFullName)
2124 If AddInFileInstalled Then
@@ -68,8 +71,15 @@ Function FileCopy(SourceFilePath, DestFilePath)
6871 FileCopy = True
6972End Function
7073
74+ Function DeleteFile(FilePath)
75+ set fso = CreateObject( "Scripting.FileSystemObject" )
76+ fso.DeleteFile FilePath
77+ DeleteFile = True
78+ End Function
79+
7180Function CreateMde(SourceFilePath, DestFilePath)
7281 Set AccessApp = CreateObject( "Access.Application" )
82+ msgbox SourceFilePath & " -> " & DestFilePath
7383 AccessApp.SysCmd 603 , (SourceFilePath), (DestFilePath)
7484 CreateMde = True
7585End Function
0 commit comments