Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Über Private Sub Worksheet_BeforeDoubleClick

Forumthread: Über Private Sub Worksheet_BeforeDoubleClick

Über Private Sub Worksheet_BeforeDoubleClick
13.07.2004 22:56:45
Giuseppe
Hallo Freunde,
mit der Code öffne ich der Datei mit der Name der aktive Zelle.
Ich möchte auch, dass wenn der Datei nicht vorhanden ist ein Hinweiß
erscheint:" Die Rechnung ist nicht gespeichert!".
Wie soll ich der Code ändern damit richtig funktioniert?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Dim sPath As String, S As String, dat As String
S = ActiveCell.Value
sPath = "C:\OFFICE CONTROL ©\Rechnungen\"
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
ActiveWorkbook.PrecisionAsDisplayed = False
ActiveWorkbook.UpdateLinks = xlUpdateLinksNever
On Error Resume Next
Workbooks.Open Filename:=sPath & S
If Err > 0 Then
'If MsgBox = " Die Rechnung " & S & " " & " ist nicht gespeichert!!" Then
Exit Sub
End If
End If
With Application
.DisplayAlerts = True
End With
ActiveWorkbook.PrecisionAsDisplayed = True
End Sub

Danke für eure Hilfe
Giuseppe
Anzeige

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Über Private Sub Worksheet_BeforeDoubleClick
Ramses
Hallo
ändere die Zeilen
If Err &gt 0 Then
'If MsgBox = " Die Rechnung " & S & " " & " ist nicht gespeichert!!" Then
Exit Sub
End If
in
If Err &gt 0 Then
MsgBox " Die Rechnung " & S & " " & " ist nicht gespeichert!!"
Exit Sub
End If
Gruss Rainer
Anzeige
AW: Über Private Sub Worksheet_BeforeDoubleClick
Giuseppe
Danke Rainer: schnell, unbürokratisch,gut!!
Danke nochmal
Giuseppe
AW: Über Private Sub Worksheet_BeforeDoubleClick
Ulf
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Dim sPath As String, S As String, dat As String
S = ActiveCell.Value
sPath = "C:\OFFICE CONTROL ©\Rechnungen\"
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
ActiveWorkbook.PrecisionAsDisplayed = False
ActiveWorkbook.UpdateLinks = xlUpdateLinksNever
If Dir(sPath & S) = "" Then
MsgBox "Die Rechnung " & S & " " & " ist nicht gespeichert!!"
Application.DisplayAlerts = True
ActiveWorkbook.PrecisionAsDisplayed = True
Exit Sub
End If
Workbooks.Open Filename:=sPath & S
Application.DisplayAlerts = True
ActiveWorkbook.PrecisionAsDisplayed = True
End Sub

Ulf
Anzeige
AW: Über Private Sub Worksheet_BeforeDoubleClick
DANKE
.
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige