Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Pommy
 
Posts: n/a
Default Trying to close Excel Application in IE

From a Excel workbook opened in IE, I want to use a Macro button to run VB
code to close the workbook, Quit the Application and return to IE. The code I
have seems to work outside IE but not in the IE environment.

Macro1()
If IsEmpty(ActiveSheet.Range("c66")) Then
MsgBox "Please enter Confirmation!"
Exit Sub
End If

Dim sPath As String
sPath = "\\J:\html\Content\Direct\Manu\MAN_LOGISTICS_IPT\q ms
mk2\BaaNFormSub\"

On Error Resume Next
ActiveWorkbook.Saveas sPath & ActiveSheet.Range("c4").Value
If Err.Number < 0 Then
MsgBox "File not saved!" & vbLf & "contact 65128"
Err.Clear
End If

For Each w In Application.Workbooks
w.Close
Next w
Application.Quit

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Trying to close Excel Application in IE

Not a solution, but maybe a workaround...

How to Configure Internet Explorer to Open Office
Documents in the Appropriate Office Program Instead of in Internet Explorer
http://support.microsoft.com/?scid=162059

I do my best to avoid opening excel in MSIE.

Pommy wrote:

From a Excel workbook opened in IE, I want to use a Macro button to run VB
code to close the workbook, Quit the Application and return to IE. The code I
have seems to work outside IE but not in the IE environment.

Macro1()
If IsEmpty(ActiveSheet.Range("c66")) Then
MsgBox "Please enter Confirmation!"
Exit Sub
End If

Dim sPath As String
sPath = "\\J:\html\Content\Direct\Manu\MAN_LOGISTICS_IPT\q ms
mk2\BaaNFormSub\"

On Error Resume Next
ActiveWorkbook.Saveas sPath & ActiveSheet.Range("c4").Value
If Err.Number < 0 Then
MsgBox "File not saved!" & vbLf & "contact 65128"
Err.Clear
End If

For Each w In Application.Workbooks
w.Close
Next w
Application.Quit

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Pommy
 
Posts: n/a
Default Trying to close Excel Application in IE

Dave,
Thanks for that. Unfortunately this workbook is to be accessed by
many users and changing the settings as you suggest is not allowed in our
current environment.
From a different angle, would it be possible to turn IE off, manipulate the
Workbook close Excel down and then recall IE ?
"Dave Peterson" wrote:

Not a solution, but maybe a workaround...

How to Configure Internet Explorer to Open Office
Documents in the Appropriate Office Program Instead of in Internet Explorer
http://support.microsoft.com/?scid=162059

I do my best to avoid opening excel in MSIE.

Pommy wrote:

From a Excel workbook opened in IE, I want to use a Macro button to run VB
code to close the workbook, Quit the Application and return to IE. The code I
have seems to work outside IE but not in the IE environment.

Macro1()
If IsEmpty(ActiveSheet.Range("c66")) Then
MsgBox "Please enter Confirmation!"
Exit Sub
End If

Dim sPath As String
sPath = "\\J:\html\Content\Direct\Manu\MAN_LOGISTICS_IPT\q ms
mk2\BaaNFormSub\"

On Error Resume Next
ActiveWorkbook.Saveas sPath & ActiveSheet.Range("c4").Value
If Err.Number < 0 Then
MsgBox "File not saved!" & vbLf & "contact 65128"
Err.Clear
End If

For Each w In Application.Workbooks
w.Close
Next w
Application.Quit

End Sub


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Trying to close Excel Application in IE

I don't know how to do that.

Maybe someone else can jump in with a better solution.

Pommy wrote:

Dave,
Thanks for that. Unfortunately this workbook is to be accessed by
many users and changing the settings as you suggest is not allowed in our
current environment.
From a different angle, would it be possible to turn IE off, manipulate the
Workbook close Excel down and then recall IE ?
"Dave Peterson" wrote:

Not a solution, but maybe a workaround...

How to Configure Internet Explorer to Open Office
Documents in the Appropriate Office Program Instead of in Internet Explorer
http://support.microsoft.com/?scid=162059

I do my best to avoid opening excel in MSIE.

Pommy wrote:

From a Excel workbook opened in IE, I want to use a Macro button to run VB
code to close the workbook, Quit the Application and return to IE. The code I
have seems to work outside IE but not in the IE environment.

Macro1()
If IsEmpty(ActiveSheet.Range("c66")) Then
MsgBox "Please enter Confirmation!"
Exit Sub
End If

Dim sPath As String
sPath = "\\J:\html\Content\Direct\Manu\MAN_LOGISTICS_IPT\q ms
mk2\BaaNFormSub\"

On Error Resume Next
ActiveWorkbook.Saveas sPath & ActiveSheet.Range("c4").Value
If Err.Number < 0 Then
MsgBox "File not saved!" & vbLf & "contact 65128"
Err.Clear
End If

For Each w In Application.Workbooks
w.Close
Next w
Application.Quit

End Sub


--

Dave Peterson


--

Dave Peterson
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
Can not open excel files without open application Taarfa Excel Discussion (Misc queries) 3 July 9th 05 11:56 PM
Displaying MS Excel Chart control in ASP.NET Application oursmp Charts and Charting in Excel 0 April 20th 05 04:17 PM
Excel Caused Error in VBE6.dll. Excel will Close mikeF New Users to Excel 0 March 3rd 05 02:01 PM
Excel application as an ERP platform for medium size production plan Adi Excel Discussion (Misc queries) 2 December 28th 04 03:25 PM
Why does spelling check close Excel when checking spanish? RCP Excel Discussion (Misc queries) 2 December 4th 04 07:37 PM


All times are GMT +1. The time now is 09:59 AM.

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"