Excel will not open

G

Gimp

I'm not sure what I've done or how to fix it. But, I added the
following to a macro:

Application.Visible = False
UserForm1.Show
Application.Visible = True

I was attempting to hide the worksheets behind the form, it seemed to
work OK until I clicked on a button that was to copy values from
various comboboxes and textboxes to a sheet and perform a print
preview. (which worked perfectly until I added the above code.)

Once I hit the button, excel shut down on me and now the workbook will
not open, as if the 'application.visible = false' is still running. If
I open Microsoft Excel, a blank sheet, then open my workbook, it will
open. But, when I go to the code, it's not there? Can anyone clue me
in on what I did? And is there a way to fix it? Also, I copied this
now open file and saved it to another name, but still won't open when
it's doubled clicked...
 
G

Gimp

Additional note, as I'm researching this problem I see I can no longer
open any excel file by double clicking on it. It will open if I open
Excel App first, then access the file(s) via the File Open button.
Again, any thoughts on this would be great....
 
G

Gimp

Thanks, I checked Task Manager before but only the application list.
excel.exe was still running as a process, ended it and it all seems OK
now. Thanks

But, one thing, when I check for this nasty code, it was no longer in
the macro. I assume that is because when excel shut down it did not
save my changes? Yes?

Again, thanks for you very quick response...

And...yes, I'm not as season'd as I wanna be.....
 
T

Tim Childs

Hi

Rob Bruce published a bit of vbs script that enables you to get that hidden
application back. Too late now but if it happens again it will help you.

bw

Tim

' === Begin script ===============
' from Rob Bruce
Dim objXL, strMessage
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If
MsgBox strMessage, vbInformation, "Excel Status"
if strMessage = "Excel Running." then objXL.Visible = true
' === End script ===============
 
G

Gimp

Thanks to all that 'chimmed' in and helpped out. I am new at working
with VBA let aone with a user form. I must say however with the
assistance of many on this group I've made good progress (i'm demoing
what I have so far today..).

Anyway, I was attempting to 'hide' the sheets from the back ground
before the app crashed. What I ended up doing is using .xlveryhidden
on 3 of the 4 sheets, when the workbook is opened. Only one sheet
shows when the book is open. That sheet just has our company logo that
is linked to a macro. When clicked it runs my splash screen and sets
the 3 sheets visible = true. Now when the user form is shown, I made
it bigger to cover most of the screen, two comboboxes have a
worksheet.active to 'get the data' and I proceed with the form, which
include mostly textboxes and math calcs. When the form is closed, via
a button, the 3 sheets are set to .xlveryhidden again.

Maybe not as graceful as you experts would put together, but for me it
seems to do the trick. Does anyone see a problem or potential issue
with this configuration?

(by the way, after my demo today I'm sure I'm going to end up with a
laundry list of things to add...)
 

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