2 excel windows

F

filo666

Hi, I'm tryng to accomplish something difficult to explain:
If you open a workbook (ex. hello.xls) and the you go to file-->open another
file (ex. hello2.xls) then you have hello.xls and hello2.xls in the same
excel window, but if you open hello.xls ant then you go to the excels general
icon (the one that opens an excel window with a new woorkbook on it) ant
then you choose file-->open hello2.xls then you have 2 excel windows, now my
problem: I have my firs book hello.xls with all the menu bars disabled but
the woorkbook hello2.xls needs all the menu bars enabled so if I open my
workbook as explained on the second way to open the file I can have my file
hello.xls without the menu bars and hello2.xls with all the menu bars
enabled; BUT I NEED TO OPEN EXCELS GENERAL ICON TO ACHIVE THIS, I mean, I
cant paste a shortcut in the desktop because when I open the second file, it
opens in the excels window of my first file.
It's very important that the user of my program could open the file from the
desktop, so there is a way to do what I want?????
Hope this have sence, TIA
 
M

Mel Arquiza

Hi Filo666,

See if this code below works for you.

Sub Auto_Open()
On Error Resume Next
SetCurrentDirectory ThisWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.DisplayFullScreen = True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

Sub Auto_Close()
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
Application.DisplayFullScreen = False
ActiveWindow.DisplayHeadings = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Set objExcel = GetObject(, "Excel.Application")
objExcel.Quit
Application.WindowState = xlMinimized
ThisWorkbook.Close SAVECHANGES:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top