|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
For Each c As Control In Me.Controls
If TypeOf c Is TextBox Then
If c.Text.Length = 0 Then c.Dispose()
End If
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Instead of checking for checkboxes you can also check for domainupdown, and any control.
In this example code, you can check what other options you can find behind c, if you want to apply some other logic.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
In my code, after execution of the following code.
dim d as new Excel.Application
create an excel instance.
and opening an excel file by using the following code.
d.Workbooks.Open(ExsTemplate & "sheet.xls")
Now i try to open an excel file by double clicking it, which is lying in my hard drive.
this open sheet.xls file also , in the taskbar.
Can you tell me why sheet.xls should open?
Thanks
|
|
|
|
|
hi,
you need to close the excel book in your program.
workbooks.close
thanks
|
|
|
|
|
i HAVE 35-40 LINES OF CODE, before i closes the workbook.
and meanwhile user tries to open an excel file, which results in opening the file (Sheet.xls).
Any idea?
|
|
|
|
|
Yep, when you use Excel in your application, this is the rick you take. A use can launch external .xls files by double clicking on them and they will show up in the Excel that you launched in your code. You can't prevent it.
So what's the question?
|
|
|
|
|
Should the file get opened in compatibility mode?
Which ever file is opening , the compatibility mode text get appending with the file name, until the instance is killed.
|
|
|
|
|
That depends on the file. I have no idea what you're users are opening, so yes, it's possible.
|
|
|
|
|
|
no idea!
|
|
|
|
|
Set IgnoreRemoteRequets to True to force excel to open a new instance of excel.exe for each workbook, this may cause undesired behavior and may cause links to not work. Save your sheet when you set ignoreremoterequests to true.
This will prevent all worksheets opened programtically when a user opens a workbook from his desktop.
|
|
|
|
|
hi,
initially i connect crystal report with ms access.
its work perfectly.
but now im secure my access Db(using set password)
its cant able to connect with crystal report...
some window will appear.
its showing servername,database,userid and password..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Either add the login info to the connect string you're sending to the report, or open the report in crystal designer, update the connection info and resave the report.
Even when you hand crystal a connection to the database, it still authenticates itself to retrieve the data.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
Hello,
I also faced this problem. What I do is add a new system DSN at ODCB. After that, open the crystal report file and change the connection to the ODBC.Hope this can help you.
Thank You !
yutu
|
|
|
|
|
Hi,
I opened ten excel files, and all files are coming under one process in the task manager.
Is there any option to find all the excel file names which are lying in this excel process?
Thanks
|
|
|
|
|
Perhaps if you use the interop stuff to interact with Excel directly.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
You're going to have to use Office Interop to get the list of opened workbooks from Excel.
|
|
|
|
|
can u provide some sample code to process it?
|
|
|
|
|
Set IgnoreRemoteRequets to True to force excel to open a new instance of excel.exe for each workbook, this may cause undesired behavior and may cause links to not work. Save your sheet when you set ignoreremoterequests to true.
This will prevent all worksheets opened programtically when a user opens a workbook from his desktop.
|
|
|
|
|
I have a DatagridView with 10-columns and Allow user to add new row is True.
But the problem is when the user entering the data's in new row's from the last row, when they
entered the data in 4th cell, they like to save the data.
But it's not saving, the uncompleted last row.
Iam using the following for save.
-----------------------------------------------------------
Dim DAD31 As SqlDataAdapter,DS31 As New DataSet,DTB31 As New DataTable
Dim Save_4 As String = "insert into itemmst (itm_description) values (&itm_description)"
DAD31.InsertCommand = New SqlCommand(Save_4, con)
con.Open()
Dim Trans As SqlTransaction
Trans = con.BeginTransaction
DAD31.InsertCommand.Transaction = Trans
Try
DAD31.Update(DS31.Tables(0))
Trans.Commit()
Catch ex As Exception
If Not Trans Is Nothing Then
Trans.Rollback()
End If
MsgBox(ex.Message)
End Try
con.Close()
----------------------------------------------------------------
THANK YOU ! For Your Valuable Minutes !!!
|
|
|
|
|
You shouldn't be using a DataGridView for data entry, but, that's up to you.
What IS it doing? Are there any exceptions?? Your code snippet is swallowing them, hiding them from you. This is, obviously, really bad practice. You should be doing something with the exceptions that will show you what they are.
|
|
|
|
|
Hi
I am using VB 6.0. I am working on an application involving Com port.
I need to send messages to com port continously and when I recieve data from the other end i need to perform another action. So I should put the data to be sent in a queue and when I recieve response from the other end I should remove first element in the queue and process that.
using queues is an appropriate one. I can't use .NET now. In .NET it's very simple using System.Collections.Queue.
Thanks in advance
|
|
|
|
|
Member 3057887 wrote: I am using VB 6.0.
Why would you do such a thing ? Have you lost a bet ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi
Thanks for replying so soon
I did not bet at all. The application is already developed in Vb 6.0. To convert it into .NET it takes some time. But we dont have much time as we have demo tomorow.
|
|
|
|
|
There is no threading support in VB6. For a workaround (if you port your app to .NET later) I would try something with a timer control, that pools your serial. Thats NOT good practice, but probably a quick and dirty way...
Regards: Didi
|
|
|
|
|
I'm trying to do the same. All I need is how to implement queues in vb 6.0. Is there any way like System.Collections.Queue in .NET. I want to put all the messages to be sent into a queue. when the comport receives response from the other end I will take out the first element in the queue and use that.
regards
|
|
|
|