LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help on closing object properly

I've made an application in VB 6.0. From this I do the following:

1.
Open specific Excel-file

2.
Automatically insert data into the now open Excel, based on values in
the VB-application.

3.
Cut all bonds to the Excel-application, but leave it open for further
work and saving.

4.
It should be possible to close the Excel file doing the above several
times.

This is what I use to open:

---code begin
Dim xlo As excel.Application
Dim xloW As excel.Workbook

Dim myCount As Integer, x As Integer, NewMeasure As Integer
Dim isEven As Boolean

If xlo Is Nothing Then
Set xlo = New excel.Application
Else
Set xlo = excel.Application
End If
Set xloW = xlo.Workbooks.Open("u:\excel\kontrolkort.xls")
xloW.Application.Visible = True
...
---code end

Currently I have a "Set xlo = Nothing" at the end. But if I close
Excel, Excel is not visible but I can see it as a running process. If
I attempt to open it again through my VB-app it errors.

Am I approacihing it wrongly?



Regards /Snedker
 
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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
2 Label Options - Forms Object vs Control Box Object Awrex Excel Discussion (Misc queries) 3 July 17th 09 07:10 PM
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Range object to Array object conversion Tom Ogilvy Excel Programming 0 August 1st 03 12:16 AM


All times are GMT +1. The time now is 05:05 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"