|
Thank you for reply.
I have ocx control on my form at design time.
Now I call form_initialize method but get dependency error from windows.
Steps I do.
1- A registered ocx control on VB Form.
2- Make an exe of my program.
3- Un-register the control using regsvr32 -u <control ocx="" path="">
4- Now if i run exe I get dependency error.
I want to handle that error. Please tell.
Thank you.
|
|
|
|
|
vhassan wrote: I want to handle that error. Please tell.
I assume the point of this is to try to work out if you have your control registered, and give an intelligent error message ? Your best bet is to handle the specific exception type, catch it, and show an error message, and exit.
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
|
|
|
|
|
Not under VB6. You only get the On Error Resume Next thing, which sucks.
|
|
|
|
|
I'll say it again. You can't. The error is thrown before any of your code runs.
|
|
|
|
|
hi.
my application's main form is dependent on a control ocx. I want to handle the exception if ocx is not registered on machine if user has no privileges to registered it.
please tell me how can i do that.
Thanks
modified on Monday, June 8, 2009 8:46 AM
|
|
|
|
|
The best you've got in VB6 is to use On Error Resume Next before the code that creates an instance of the object. If you're just using the designer and dropping the contorl on the form, you've got no options but to remove the object from the form and create it manually in your code, just after the On Error line. Right after the line of code you use to create the object, you can check the value of Err.Number If it's non-zero, something went wrong.
|
|
|
|
|
Hello every one,
I am working with VB 2005 application.
I have to create a brush with the background color of a label already displayed on screen.
Depending on options selected by the user the background color of label changes. I want to create the brush of that background color.
Can any one plz help me out with it.
Regards
Nishkarsh
|
|
|
|
|
Dim b As Brush = New SolidBrush(Label1.BackColor)
|
|
|
|
|
|
why would you want to remove it? I rather hide it YourDomainUpDown.Visible = False
Regards: Didi
|
|
|
|
|
Didi, Thanks for the falsifying visible code. I want to remove it because a few domainupdown controls may not be filled with values at runtime. I want to do away with these controls alone which do not contain any values. Can they be removed ?
|
|
|
|
|
...you have got your answer, see post of Johan Hakkesteegt below.
Good luck: Didi
|
|
|
|
|
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
|
|
|
|