473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 1216

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

Similar topics

5
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
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,...

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.