|
When you say release the Excel.Applicatin reference means..the code should be look like following
myExcel.Applilcation.Quit()<br />
myExcle.Application = Nothing<br />
Is it the way to realease the Excel.Application reference?
If so I have it in my code and it is still not terminating Excel process.
I have the function that gets the event when excel workbook is closed.
How about killing the process.
If I can get process ID of Excel application, is there any function that kills the process given by process ID??
|
|
|
|
|
You could kill the process off, but it's not necessary. It will close completely when your app quits. Here's a little code example to do it:
Dim proc As Process
appExcel.Quit()
appExcel = Nothing
Dim exProcess() As Process = Process.GetProcessesByName("Excel")
If exProcess.Length > 0 Then
For Each proc In exProcess
proc.Kill()
Next
End If
RageInTheMachine9532
|
|
|
|
|
This will also kill off instances of Excel that were started outside of the app in question. Not only that, but using Kill instead of CloseMainWindow (in this case, not generally) will ensure two things:
1) You won't get a save prompt for any workbooks that weren't saved in the instances you didn't want closed, making it quite likely that your users will lose data if they run multiple instances of Excel while using your app.
2) Your users will not like you very much.
Charlie
if(!curlies){ return; }
|
|
|
|
|
He asked, I supplied a method to do it! I know it's a bit of an overkill but its simple and it works.
RageInTheMachine9532
|
|
|
|
|
Anybody built their own property editors.
I have a gradient like object, with a start and end color, and some other custom stuff. I'd like to pop up a dialog to edit the details of the gradient, but I'm finding the docs on doing so a little hard to understand.
Nursey
|
|
|
|
|
anyone know about any webpage that teach ppl about text file handling in VB.net?
i wish to learn all the basic file and stream IO to handle a normal text associate with my project
heard that there are many methods in file and stream, i hope can get the easiest..
|
|
|
|
|
|
i am relatively new to visual basic .net so these questions will probably be on the dumb side. i bought visual basic .net standard Ed. (i couldn't afford to get the studio version) and was wondering if the .net framework SDK came with it, if not should i install it. does it also come with the redistributable package, or would i have to download that too. Finally, today i found an update for the SDK framework documentation that came out in October, should i download that also. any help on these things would be greatly appreciated.
Thanks.
Dave Pursey.
|
|
|
|
|
The framework and the SDK come with visual studio, you don't have to install them again.
The redistributable package contains only the framework, without the SDK. I think it is included in the visual basic installation - it has to be installed only on other machines to run .net applications.
|
|
|
|
|
Hi, does anybody know where how can I append new elements to an existing xml file with the xmltextwriter?.
Anyother apprach would be appreciated too...
Thanks in advance.
|
|
|
|
|
Hi all!
I’m new to the group; I had a friend in my computer science class tell me about the group. So my problem is this.
I’m building a program for a charity group what they want it to do is take a picture of someone via webcam and then email it to anyone the use specifies a lot like the one at the Microsoft Museum If anyone has been there. So it has turned into my class project. I have ran into a problem with the sending of the email.
The program won’t be using a local SMTP server it will be using one like Comcast (smtp.comcast.net) when I run the program everything is fine until it runs the last line of code and then I get this error message.
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Could not access 'CDO.Message' object.
I was wondering if anyone could help me with it?
I have tried declaring the SMTP server in different areas but nothing seems to work
Thanks for any help
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim <big>objEmailMessage</big> As System.Web.Mail.MailMessage<br />
Dim objSMTPServer As System.Web.Mail.SmtpMail<br />
objSMTPServer.SmtpServer = "smtp.comcast.net"<br />
<br />
objEmailMessage = New System.Web.Mail.MailMessage<br />
With objEmailMessage<br />
.To = "crazyboutcomputers1@comcast.net"<br />
.From = txtFrom.Text<br />
.Subject = "Great Job!"<br />
.Body = "Want all my money?"<br />
<br />
End With<br />
<br />
<big>objSMTPServer.Send(objEmailMessage)</big><br />
<br />
End Sub<br />
The code in red at the bottom is what im have truble with
and when i click go to definition it gos to the one in green at the top.
Agen Thanks for any Help
|
|
|
|
|
Your problem is that you instantiated an SmtpMail object. You don't have to. SmtpMail is one of those objects that you just use, kind of like a service that's been declared already. Just a little tweak of your code results in this:
Dim objEmailMessage As System.Web.Mail.MailMessage
objEmailMessage = New System.Web.Mail.MailMessage
With objEmailMessage
.To = "crazyboutcomputers1@comcast.net"
.From = txtFrom.Text
.Subject = "Great Job!"
.Body = "Want all my money?"
End With
SmtpMail.SmtpServer = "smtp.comcast.net"
SmtpMail.Send(objEmailMessage)
This should work for you. Oh! Don't forget the reference to System.Web!
RageInTheMachine9532
|
|
|
|
|
the error I'm geting now is
( name smtpmail not decalrad )
Its refuring to the last 2 lines of code.
|
|
|
|
|
Do you have this at the top of your code? I assumed you did already, based on your example. My mistake!
Imports System.Web.Mail
RageInTheMachine9532
|
|
|
|
|
I want autogenerated column every time I save Information.
In case i delete a record then,
Eg
The auto generated Nos are 1 2 3 4 5, and i remove 3 and 4 then the 5th record must automatically take the place of the 3rd record(just like what happens in Excel)How do i do it?
|
|
|
|
|
If the autogen'd numbers are the primary key, then you don't get to do that. Once an autogenerated number is used it is never used again, even if it has been deleted.
The only way your going to accomplish this is if you generate the number yourself and keep track of which numbers have been used and which hasn't. More trouble than it's worth...
RageInTheMachine9532
|
|
|
|
|
Hai,
Any body know about disabling javascript errors/popups on AxWebbrowser?
Thanks in advance.
Ajai
|
|
|
|
|
Hi All,
How can i bind a datasource(dataset or datatable) for a crystal report in runtime.And also how can i insert a database field in the crystal report at runtime.
Can any one hep me on this?
Regards
Shabu.K
|
|
|
|
|
Hi
If any one knows about usage of Comm .net ,please help me ......let me say thanxs in Advance
Thanxs
|
|
|
|
|
I would like to grab an HTML page from a WebBrowser control and thumbnail it to a picturebox control. Anyone out there know how to do this?
The only way I can see to do this is to use shareware or a commercial product to convert an html page to a bmp, external to the program, save it on disk and then use GetThumbnailImage to thumbnail it.
Thanks, GregC
|
|
|
|
|
Can anyone help with a recursive example such as a bill of material to make a product. Need to enter top part number and get tree structure of the product.
|
|
|
|
|
A little more specificity may help those wishing to help you.
frank9876 wrote:
make a product...
get tree structure of the product
That doesn't immediately strike me as making any sense whatsoever.
Charlie
if(!curlies){ return; }
|
|
|
|
|
thanks for trying. It makes sense to someone who is familiar with manufacturing and understands engineering product structures / bills of material.
|
|
|
|
|
frank9876 wrote:
thanks for trying. It makes sense to someone who is familiar with manufacturing and understands engineering product structures / bills of material.
Since this is a programming forum, maybe you'd get a better response if you phrased your question in such a way that someone who knows how to code well could answer, rather than hoping someone with exprience in a very speific, non-programming field comes along.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I am new to VB.Net so forgive me if this is a stupid question! I am trying to write a service that periodically goes out to another server drive and checks to see what files are in a directory and the file size. If the file size of any given file is zero, it sends an email alerting IT that the backup file size is null. I have set a server timer and have the email portion working, but it will not read the directory. Can anyone give me a direction to pursue? Thanks!
Stacy Springer
|
|
|
|