473,493 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

second post - email being bloaked at work


I am using a datagrid to populate a spreadhseet. The code
works fine (posted below formated to fit in this box, any
suggestions/better way let me know). The problem is that
the excel instance is not being destroyed. This is an
asp.net application using vb.net

Dim x As Integer
Dim s As String
Dim objExcel As New Excel.Application()

Try
With objExcel
.Visible = False
.Workbooks.Open("C:\WITemplates\WIReports.xlt")

For x = 1 To dgAnomaly.Items.Count
.Cells(x, 1) = dgAnomaly.Items.Item(x - 1).Cells(0).Text
.Cells(x, 2) = dgAnomaly.Items.Item(x - 1).Cells(1).Text
.Cells(x, 3) = dgAnomaly.Items.Item(x - 1).Cells(2).Text
.Cells(x, 4) = dgAnomaly.Items.Item(x - 1).Cells(3).Text
.Cells(x, 5) = dgAnomaly.Items.Item(x - 1).Cells(4).Text
.Cells(x, 6) = dgAnomaly.Items.Item(x - 1).Cells(5).Text
Next
End With
objExcel.ActiveWorkbook.SaveAs("c:\test.xls")
Catch obj As Exception
s = obj.Message
Finally
objExcel.Quit()
objExcel = Nothing
End Try

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
0 1219

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4244
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
2
6127
by: Robert | last post by:
I am using the php4-cgi Debian package which is based on PHP 4.3.4. I have problems when running php4 on the command line. If I say something like $ php4 index.cgi a number of variables...
0
1829
by: Hans Forbrich | last post by:
Section 1. Ballot: ------------------- 1.YES NO: I agree that there should be a periodic post describing the newsgroup charter and providing a FAQ on newsgroup usage. 2.MONTHLY BI-WEEKLY...
0
1800
by: Hans Forbrich | last post by:
Section 1. Ballot: ------------------- 1.YES NO: I agree that there should be a periodic post describing the newsgroup charter and providing a FAQ on newsgroup usage. 2.MONTHLY BI-WEEKLY...
12
4868
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
3
1816
by: Chris Thompson | last post by:
I have a page that uses a custom object I wrote to build a table. I also have a post back to the page to remove items from that table. When the page loads I can see the viewstate code on the...
24
2856
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
4
2461
by: Jamey Shuemaker | last post by:
A2k2 with user-level security and all preventive measures, vis a vis, Security FAQ enabled or enacted. I've got three DBs, which due to size constraints can't, or rather, probably shouldn't be...
6
1822
by: vjp2.at | last post by:
Suppose I have a string "12-34 56th Loway" and I want to know if 4 is odd. Is there someway to do it with STR$ and MID$ &al
2
9377
doc barleycorn
by: doc barleycorn | last post by:
I am trying to have a guestbook form on one page write to a second page. The pages are .html, and I know they need to be .asp, but every script I have tried doesnt work. My hosting account is shared...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.