ich hoffe das Problem wurde hier so noch nicht gepostet. Ich hab folgendes Problem:
Mit einer Routine in Mappe1 schreib ich mir diesen code in Mappe 2 in das Excel-Objekt "DieseARbeitsmappe":
Code Mappe2:
Option Explicit
'27.01.2011 15:22:26Uhr: Erstellt durch Reportingtool für FiNAS-Anmeldung
Public bolAnmeldung As Boolean
Sub Anmeldung()
bolAnmeldung = True
End Sub
Public Function Abfrage() As Boolean
Abfrage = bolAnmeldung
End Function
-------------
Dann rufe ich aus Mappe 1 die Funktion Anmeldung auf:
bolBlub = Application.Run("'" & wbStatusdatei.Name & "'!DieseArbeitsmappe.Finas", True)
--> Damit wird die Variable bolAnmeldung in Mappe 2 auf true gesetzt.
Danach frage ich den Wert von bolAnmeldung (also Mappe 2 ist immer noch geöffnet) ab:
MsgBox Application.Run("'" & wbStatusdatei.Name & "'!DieseArbeitsmappe.Abfrage")
Als Ergebnis bekomme ich leider nur eine leere Variable raus und nicht den Wert der eigentlich da drin steht. Was mache ich falsch?
Hier mal der komplette Code hierfür von Mappe 1:
Sub testtest()
Dim wbStatusdatei As Workbook
Dim blub As Boolean
Set wbStatusdatei = ActiveWorkbook
blub = Application.Run("'" & wbStatusdatei.Name & "'!DieseArbeitsmappe.Anmeldung")
blub = Application.Run("'" & wbStatusdatei.Name & "'!DieseArbeitsmappe.Abfrage")
MsgBox Application.Run("'" & wbStatusdatei.Name & "'!DieseArbeitsmappe.Abfrage")
End Sub
Was mache ich falsch?
Vielen Dank schonmal.