Hi,
I have this code and want to show a msgbox at the end of the code. The user should have the option to click yes and then open the file specified in "sFileName".
I have tried this code, but I can't figure out how to use the "sFileName" right.
Maybe you can help me?
Best regards
Morten
I have this code and want to show a msgbox at the end of the code. The user should have the option to click yes and then open the file specified in "sFileName".
Code:
Private Sub Knap_MDMDatotjek_gem_Click()
sFileName = "P:\CØK\Lukkede Mapper\Indkobsafdelingen\SUPPORT OG ANALYSE\VARESTAMDATA OG KATALOG\MDM Syndicator Opfølgningsværktøj\Datotjek rapporter\MDMDatotjek_" & Format(Now(), "yyyymmdd-HHnnss") & ".xlsb"
Select Case Me.Frame_MDMDatotjek.Value
Case Is = 1
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "q_chk_Indgaaende", sFileName, True, "Indgående"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "q_chk_Aaben_Koebbar", sFileName, True, "Aaben_koebbar"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "q_chk_Aaben_Ikke_Koebbar", sFileName, True, "Aaben_ikke_koebbar"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "q_chk_Lukket", sFileName, True, "Lukket"
Case Else
End Select
MsgBox ****
End Sub
I have tried this code, but I can't figure out how to use the "sFileName" right.
Code:
If (MsgBox("Filen er gemt på "sFileName" & vbCrLf & "Vil du åbne filen?", vbYesNo)) = vbYes Then Shell "excel.exe" & " " & "sFileName", vbNormalFocus
End If
Maybe you can help me?
Best regards
Morten