Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default application.visible problem

Hi,

My application is not visible because the application works entirely within a
userform.
However if an error occurs, the userform is shut down and i see nothing
anymore...

is there a way to have excel reappear when an error appears at any time ?

or is there a key combination to have excel reappear after my application is
closed ?

Thanks,
Pierre


--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default application.visible problem

Pierre,

How are you handling the errors? Do you trap them, or do they just bomb?

Are you minimizing Excel?

Any code you can share?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:569dcdf4d06e7@uwe...
Hi,

My application is not visible because the application works entirely

within a
userform.
However if an error occurs, the userform is shut down and i see nothing
anymore...

is there a way to have excel reappear when an error appears at any time ?

or is there a key combination to have excel reappear after my application

is
closed ?

Thanks,
Pierre


--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default application.visible problem

Hi

Put this vbscript on your desktop and just doubleclick it and excel should
re-appear.
Create the file with notepad and name it "Activate Excel.vbs" and save it.



Dim objXL
Dim strMessage

On Error Resume Next

' Try to grab a running instance of
' Excel...
Set objXL = GetObject(, "Excel.Application")

' What did we find?..
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If

' Feedback to user...
MsgBox strMessage, vbInformation, "Excel Status"

' Make the Excel instance visible
' if we found one
if strMessage = "Excel Running." then _
objXL.Visible = true



Also, in your before_close code and any error trap, put

Application.Visible = true

HTH

Ken


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default application.visible problem

Hi bob,

i'am using

application.visible = false
error handling : they just bomb...

My code is very large (over 1000 lines) and put in many macro's so hard to
display here...
thanks,Pierre

Bob Phillips wrote:
Pierre,

How are you handling the errors? Do you trap them, or do they just bomb?

Are you minimizing Excel?

Any code you can share?

Hi,

[quoted text clipped - 10 lines]
Thanks,
Pierre



--
Message posted via http://www.officekb.com
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default application.visible problem

Hi Ken,

This works fine but:

if there are two execl instances running, how can i get the one that has
turned invisible?
thanks,
Pierre

Ken Macksey wrote:
Hi

Put this vbscript on your desktop and just doubleclick it and excel should
re-appear.
Create the file with notepad and name it "Activate Excel.vbs" and save it.

Dim objXL
Dim strMessage

On Error Resume Next

' Try to grab a running instance of
' Excel...
Set objXL = GetObject(, "Excel.Application")

' What did we find?..
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If

' Feedback to user...
MsgBox strMessage, vbInformation, "Excel Status"

' Make the Excel instance visible
' if we found one
if strMessage = "Excel Running." then _
objXL.Visible = true

Also, in your before_close code and any error trap, put

Application.Visible = true

HTH

Ken



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default application.visible problem

Hi Pierre

I am not sure how you would get the second instance of excel other than to
close the first one it finds and run it again. At least this allows you to
get excel back and save any changes you might have made without losing
anything.

The only other suggestion I have is to rem(comment) out the
Application.visible=false line until you have completely debugged your code.


HTH

Ken


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default application.visible problem

Hi Ken,
Thanks for your input. the code works fine.
However, i would like to do the following when activating your code:

- see if my program is active (program called vplprog.xls)
- if active, i would like to
- check if the sheet "waarschuwing" is visible
if not visible then make this sheet visible and save and close the
workbook
thanks for your help....
Pierre

Ken Macksey wrote:
Hi Pierre

I am not sure how you would get the second instance of excel other than to
close the first one it finds and run it again. At least this allows you to
get excel back and save any changes you might have made without losing
anything.

The only other suggestion I have is to rem(comment) out the
Application.visible=false line until you have completely debugged your code.

HTH

Ken



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200511/1
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default application.visible problem

Hi

Adding this code to the bottom worked for me. Change the workbook and
worksheet names to suit. Message box can be removed as required. Just there
so you can actually see what is happening. If you don't want to close excel,
remove the last line.


if objxl.workbook.name = "Test.xls" then

objxl.worksheets("sheet3").visible = true
objxl.msgbox ""
objxl.Application.displayalerts = false
objxl.workbooks("Test.xls").save
objxl.Application.displayalerts = True
objxl.workbooks("Test.xls").close
objxl.quit

end if


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default application.visible problem

Hi

With further testing, this part of the code seems to work ok, but the
workbook name part does not.

objxl.worksheets("sheet3").visible = true
objxl.Application.displayalerts = false
objxl.workbooks("Test x2.xls").save
objxl.Application.displayalerts = True
objxl.workbooks("Test x2.xls").close
objxl.quit

Maybe someone else knows how to get the workbook name with vb script.

HTH

Ken


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Visible = False SimonB Setting up and Configuration of Excel 1 October 16th 06 09:51 PM
Application.Visible = False SimonB Excel Discussion (Misc queries) 1 October 15th 06 01:10 PM
Visible Instances of an Application TCook Excel Programming 4 October 9th 05 05:11 AM
Runnig Excel without visible application [email protected] Excel Programming 2 March 25th 05 08:48 PM
Application.visible help Glen Mettler[_4_] Excel Programming 0 February 16th 05 10:04 PM


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"