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.

Excel Datei im aktiven Excel Fenster öffnen

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich stehe vor folgendem Problem:

Ich möchte eine Excel-Datei im aktiven Excel-Fenster öffnen, d.h. wie wenn ich die Datei direkt über Excel mit der Öffnen-Maske aufrufen würde.

Mit meinem bisherigen Code öffnet sich die Excel-Datei in einem neuen Fenster:

 Dim exApp As Excel.Application = New Excel.Application()

            Dim exwb As Excel.Workbook

            Dim exsh As Excel.Worksheet

            Dim exrng As Excel.Range


            With exApp


                .Visible = True


                exwb = .Workbooks.Open(docpfull)

                exsh = exwb.Sheets(1)

                exrng = exsh.Range("A1")



            End With

In der Variable "docpfull " ist der Pfad der zu öffnenden Datei hinterlegt.

Ich hoffe Ihr könnt mir weiter helfen.

habe so etwas in C# gemacht....

 

// First Contact: Excel Prozess initialisieren

myExcelApplication = new Microsoft.Office.Interop.Excel.Application();

myExcelApplication.Visible = true;

myExcelApplication.ScreenUpdating = true;


// Excel Datei anlegen: Workbook

var myCount = myExcelApplication.Workbooks.Count;

myExcelWorkbook = myExcelApplication.Workbooks.Add(System.Reflection.Missing.Value) as Microsoft.Office.Interop.Excel.Workbook;

if (myExcelWorkbook == null)

{

    throw new ArgumentNullException();

}

Vielleicht hilft Dir das etwas weiter...

mfg ron

Du willst ja eine Datei öffnen...


string workbook = excelPath;


            xlWorkbook = xlApplication.Workbooks.Open(

                excelPath, 0, false, 5,

                "hallo", "hallo", true, XlPlatform.xlWindows, "\t",

                false, false, 0, false, 0, false

            );


            // Wir nehmen das Lager-Arbeitsblatt

            try

            {

                xlWorksheet = xlWorkbook.Worksheets["Lager"] as Worksheet;

                xlWorksheet.Unprotect("hallo");


            }

            catch (Exception)

            {

                MessageBox.Show("Kein Arbeitsblatt 'Lager' vorhanden!");

                return;

            }

...trage dein Pfad in excelPath ein...und ändere das Blatt was Du öffnen möchtest...

mfg ron

Danke schön.

Werds mal ausprobieren.

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.