Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Öffnen einer Word-Datei / Arbeitsmappe

Empfohlene Antworten

Bitte um Hilfe :

Will mit Hilfe von VB ein Dokument oder eine Arbeitsmappe öffnen beim betätigen eines Buttons , aber es läuft einfach nicht...könnt ihr mir vielleicht helfen?

Hintergrund:

Lege gerade ein Formular an das eigentlich nur mit Buttons versehen ist das als Hyperlinks zu den ganzen Formularen dient. Wenn es einfacher geht nehm ich das natürlich auch an.

Danke im Vorraus

Keiner ne Ahnung? Also habe folgendes :

Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" Alias _

"ShellExecuteA" (ByVal hwnd As Long, _

ByVal lpOperation As String, ByVal lpFile As String, _

ByVal lpParameters As String, ByVal lpDirectory As String, _

ByVal nShowCmd As Long) As Long

Private Sub CommandButton1_Click()

Dim lngRet As Long

Dim strParthAndFile As String

strParthAndFile = "C:\kim.doc"

lngRet = ShellExecute(0, vbNullString, strParthAndFile, vbNullString, vbNullString, 1)

End Sub

Komischer Weise funktioniert das bei Word Dokumenten, aber die Arbeitsmappe, also z.B. Jalla.xls öffnet er nicht....was ist das Problem?

Das muss so funzen...die Endung muss das Problem sein...also bei .doc klappt alles...änder ich das in .xls für die Arbeitsmappe macht er nichts...denkfehler?

erlich geast verstehe ich nicht ganz was du da tust, und finde in der VBA-Hilfe auch nichts zu dem befehl ShellExecute ... ( hab das office 2003 )

lies dir mal durch was zu dem befehl Shell in der hilfe steht ... damit kann man eigendlich alle möglichen programme önnen, und ihnen parameter übergeben, wie zum beispiel welche Datei sie öffenen sollen ...

:confused: :confused:

Wenn du Funktionen in VB abbilden willst, die man in Word/Excel auch mit der Maustaste ausfuehren kann, dann kann man dazu auch meistens den Makro-Aufzeichner benutzen.

Ich hab mal ein Makro fuer deinen Problemfall aufgezeichnet:


Sub hgfhfghfg()

'

' hgfhfghfg Makro

' Makro am 16.07.2007 von 49er aufgezeichnet

'


'

    ChDir "E:\"

    Workbooks.Open Filename:="E:\filme.xls"

End Sub

Jetzt musst du nur noch ueber das "Anpassen"-Fenster eine Makro-Schaltflaeche einbinden.

*EDIT*: Hab die Problemstellung falsch verstanden. Beitrag ueberfluessig.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.