Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stopping Excel after running visual basic in Access

After running the following sub the excel spreadsheet comes up. When
exiting out of excel the program appears to close but doesn't, it's
still running in the background. What's the problem?

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True



End Sub

Thanks if anyone can tell me what's wrong.
bill

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Stopping Excel after running visual basic in Access

It appears you are not closing Excel

Try putting in the line

Set ex = Nothing


Cheers
Nigel

"Bill McCaleb" wrote in message
...
After running the following sub the excel spreadsheet comes up. When
exiting out of excel the program appears to close but doesn't, it's
still running in the background. What's the problem?

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True



End Sub

Thanks if anyone can tell me what's wrong.
bill





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Stopping Excel after running visual basic in Access

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True
ex.Quit
set rng = Nothing
set wksh = Nothing
set wrkbk = nothing
set ex = nothing

End Sub

The code you show is fully qualified, but there is a possibility that this
isn't the actual code. fully qualify all references.

--
Regards,
Tom Ogilvy


"Bill McCaleb" wrote in message
...
After running the following sub the excel spreadsheet comes up. When
exiting out of excel the program appears to close but doesn't, it's
still running in the background. What's the problem?

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True



End Sub

Thanks if anyone can tell me what's wrong.
bill



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stopping Excel after running visual basic in Access

I tried this but it still didn't work. I have to shut down excel with
the task manager. Anyone have any other solutions?
bill

Nigel wrote:

It appears you are not closing Excel

Try putting in the line

Set ex = Nothing


Cheers
Nigel

"Bill McCaleb" wrote in message
...

After running the following sub the excel spreadsheet comes up. When
exiting out of excel the program appears to close but doesn't, it's
still running in the background. What's the problem?

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True



End Sub

Thanks if anyone can tell me what's wrong.
bill






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Stopping Excel after running visual basic in Access

Guess not if you are going to ignore them.

--
Regards,
Tom Ogilvy


"Bill McCaleb" wrote in message
...
I tried this but it still didn't work. I have to shut down excel with
the task manager. Anyone have any other solutions?
bill

Nigel wrote:

It appears you are not closing Excel

Try putting in the line

Set ex = Nothing


Cheers
Nigel

"Bill McCaleb" wrote in message
...

After running the following sub the excel spreadsheet comes up. When
exiting out of excel the program appears to close but doesn't, it's
still running in the background. What's the problem?

Sub xls2()
Dim ex As New Excel.Application
Dim wrkbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range

Set wrkbk = Workbooks.Open("c:\TRPWKBookA.xls")
Set wks = wrkbk.Worksheets("41 ECS")
wks.Range("b13").Value = 12
Set wks = wrkbk.Worksheets("755")
wks.Range("b13").Value = 13



'Set rng = wks.Cells(2, 13)
' With rng
' .Value =
'Set rng = wks.UsedRange.columns

ex.Visible = True



End Sub

Thanks if anyone can tell me what's wrong.
bill






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption =---



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
How do I access Visual Basic in Excel 2007 Trial? RandyS Setting up and Configuration of Excel 1 April 2nd 07 12:18 AM
visual basic within Access If...Then arabella79 Excel Discussion (Misc queries) 1 October 5th 06 09:34 PM
visual basic within Access If...Then arabella79 Excel Discussion (Misc queries) 0 October 5th 06 09:24 PM
Activate check "Trust access to Visual Basic " in Excel Pablo via OfficeKB.com New Users to Excel 1 June 23rd 05 04:30 PM
using visual basic to access a protected DB Mike Tomasura Excel Programming 2 November 21st 03 02:59 PM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"