Look in the Code Editor menu: Tools - Reference.. and see if it is not the name of the initial file there. If yes, remove the tick.
I hope this will help !?!?
If your project includes UserForm1 and on Sheet1 a CommandButton with the code calling "test":
Private Sub CommandButton1_Click()
Call test
End Sub
Sub test()
Application.WindowState = xlMinimized
AppActivate "Microsoft Excel"
UserForm1t.Show
End Sub
The...
The code works in this variant:
Dim dtFindMe As Date
Dim rgFoundMe As Range
dtFindMe = DateSerial(2002, 2, 22)
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)
If rgFoundMe Is Nothing Then
Exit Sub
End If
rgFoundMe.Font.Bold = True
End Sub
dtFindMe it...
You may make an AddInn (.xla), which will have in the Auto_Open sequence some code to put the peculiar button on a peculiar bar.
In the Auto_Open sequence the button will be delete:
Private Sub Workbook_Open()
For Each ctl In Application.CommandBars("Worksheet Menu Bar").Controls...
Me again
I found a compromis :
Private Sub Workbook_Open()
If ThisWorkbook.Name = "MyFile.xls" Then
Workbooks.Open (ThisWorkbook.Path & "\MyFileNEW.xls")
Workbooks("MyFileNEW.xls").Activate
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal...
I think it is impossible to do what you want.
If you call a macro from an other file this macro stops execution when the initial file is closed even if there are other lines to execute.
I tried to write in the Auto_Open sequence a VBScript beginning with "WScript.Sleep 5000"...