|
but I want to sort in Datagrid column because other way I want to sort another column
|
|
|
|
|
I know not to many people participate in VBA around here, but I'll post anyways
I'm trying to assign (in excel 2003, sp3) a string to the FormulaArray property of a range. The length of the string is 305, causing a crash because it is maxed over 255 characters (the error and cause is documentated poorly at http://support.microsoft.com/kb/213181, I say poorly because at the top of the article it states
This problem occurs when you try to pass a formula that contains more than 255 characters, and you are using the FormulaArray property in Visual Basic for Applications.
with no solution.
So I ask, does anyone here have any ideas as to a solution/workaround?
Thanks for the read / effort
|
|
|
|
|
Solution available at this site.[^]
Summary
''' If the long formula can be broken into parts, where the second part can
''' be replaced by a dummy function, this approach can be used...
Public Sub LongArrayFormula()
Dim theFormulaPart1 As String
Dim theFormulaPart2 As String
theFormulaPart1 = "=IF(MONTH(DATE(YEAR(NOW()),MONTH(NOW()),1))-" & _
"MONTH(DATE(YEAR(NOW()),MONTH(NOW()),1)-" & _
"(WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW()),1))-1)+" & _
"{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1),""""," & _
"X_X_X())"
theFormulaPart2 = "DATE(YEAR(NOW()),MONTH(NOW()),1)-" & _
"(WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW()),1))-1)+" & _
"{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1)"
With ActiveSheet.Range("E2:K7")
.FormulaArray = theFormulaPart1
.Replace "X_X_X())", theFormulaPart2
.NumberFormat = "mmm dd"
End With
End Sub
|
|
|
|
|
Hi,
I have a VB6 app with a VB.Net Interop user control ( a menu ).
When I click some option at the interop menu, it generates an event that is handled by the VB6 app to call a VB6 form. But after the VB6 form is called the focus remains at the interop usercontrol and then I need an aditional click to put the focus at the called form.
Thanks in advance.
|
|
|
|
|
Didn't VB6 have a SetFocus method on it's controls?? I'd say start by showing your form, the call SetFocus on the control you want the focus to move to.
|
|
|
|
|
Hi,
Yes...there's a setfocus at VB6 but it don't work at this situation.
I can see that the problem is related to modal forms and not to non modal forms
The following code works ok :
Private Sub InteropEventAtVb6()
MyVb6Form2.Show
End Sub
At the following code I need an extra mouse click to focus the form...
Private Sub InteropEventAtVb6()
MyVb6Form2.Show 1
End Sub
|
|
|
|
|
In that case, I have no idea and no way to test it. I haven't used VB6 in over 7 years.
|
|
|
|
|
|
Hello All,
I have a requirements in "Windows form exe" that when we click on the exe, the data from the Oracle database should be exported to another Oracle database and also the data that has been exported should be emailed with excel attachments to intended recipents.
I searched but couldn't get the code as such and also i am not able to implement the functionality.
It would be great, if someone can help me out in this.
Many thanks.
|
|
|
|
|
Basically it's quite simple application. For example if you want to retrieve the data through the application it could be something like:
- you create a OracleConnection against source database
- you create a OracleConnection against target database
- use OracleCommand and OracleReader to read data from source
- use OracleCommand to insert data to the target
- use MailMessage class to deliver the message
However I think that a better way would be:
- create a database link in the target database pointing to the source database
- create stored procedure which copies the data from soure to target (for example using insert into ... select from ...
- after populating the target, return ref_cursor to the added rows
- return the data to the client application and send the message
This logic would use the same classes but the transfer is much easier to code and much faster.
Hope this helps,
Mika
modified on Tuesday, January 27, 2009 9:41 AM
|
|
|
|
|
You can use the following code send you excel file as an attachment from your application.
it use an smtp server,please enter proper email id as marked in the comments , i have tested it from a gmail account
Dim smtpClient As New Net.Mail.SmtpClient()
Dim mail As New Net.Mail.MailMessage()
'create the message to be sent
mail.To.Add("test@test.com") ' Enter the Email of the person you want to send the mail to
mail.From = New Net.Mail.MailAddress("username@gmail.com", "Your Display Name") ' Enter Your email address
mail.Subject = "Test Message"
mail.Body = "This is a test message"
' Prepare the client to send the above message
'Attach the file as attachment
mail.Attachments.Add(new System.Net.Mail.Attachment("yourFileName.xls"))
smtpClient.Host = "smtp.gmail.com"
smtpClient.EnableSsl = True
smtpClient.Port = 587
smtpClient.Credentials = New Net.NetworkCredential("username@gmail.com", "password") 'Enter username and password of the account , you want to use to send mail
smtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtpClient.Send(mail)
Hope this helps
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
This works like genius Bharat. Many thanks
|
|
|
|
|
Hi,
I'm using cr 8.5 and vb6. I'm using crystal report control component in my application. I've created report with two parameters. My report is working well alone by refreshing and passing parameters. But I'm facing problem in vb6, while I call report with passing parameters. I'm getting Invalid parameter field value. This is my code below.
cr1.ParameterFields(1) = "pBankCode;" & lstrBankCode & ";True"
cr1.ParameterFields(2) = "pDate;" & Format(cmbPaymentDate, "dd/MM/yyyy") & ";True"
cr1.ReportFileName = App.Path & "\rptCovLetToCommodityPmnts.rpt"
cr1.Action = 1
Pls. anybody give me the soln. I tried in different ways. Tnx in adv.
Balasubramanian K.
|
|
|
|
|
BalasubramanianK Wrote<quate>But I'm facing problem in vb6, while I call report with passing parameters. I'm getting Invalid parameter field value.
Why do you still use vb6 in 2009 ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Yes. Mr.Vuyiswa Maseko.
My company's old prj.
Balasubramanian K.
|
|
|
|
|
Never done it in vb6 but in .net there is a method
'setparametervalue(paramname,paramvalue)'
check if you have this (watch out paramname is case-sensitive I think)
Also you set the parameters after you loaded the report and (if needed) reconnected it. So right before you show the report.
|
|
|
|
|
Firstly, Thank you for your reply. I've done in dot net well. I could pass parameter from the application. But here, I'm facing pbm in vb6 and cr 8.5.
I tried in both ways such as set parameters before and after assign the report. In both ways, I'm getting the same problem. Eventhough, I googled also, But I was getting the posts only not replies.
Balasubramanian K.
|
|
|
|
|
hi
i published one vb.net project with ms access database..... while publishing my project one error occurred like this...could not find c:/documents and settings....................../database.mdb...... how to handle this......
|
|
|
|
|
Remmber your Development Path will not be the same as your Cliients Path. VS does not Do it for you Automatically. The Error means it cant find the Database. If you have hardcoided your connection string, you shoud consider putting it in a Config File and read it from there. When you create a setup Project add the database to your Application and when you install the Application it will be in the Application Folder and make sure that the Connection string in your Config file points to the Application Folder not my Document....................
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Hi,
Looking for a bit of help. What I want to do to filter a table in my database by a month select. So for example I want to see the results for January. I have populated my dataset with all the records in my database when I first start my application.
da.Fill(ds,"Records) 'da is my dataadapter and ds is my dataset
So is there some way I can filter my dataset to show the results that I just want or should I re populate my dataset with the dataadapter using a SQL Statment such as SELECT * Records WHERE etc... Is there anyother way
Thanks for your help
|
|
|
|
|
Work with the Select method provided in DataTable class.
|
|
|
|
|
Thanks, the select method worked great
|
|
|
|
|
use can use DataView
see this
http://www.csharp-examples.net/dataview-rowfilter/[^]
Hope it helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Hi, I'm new to VB.Net.
I want help to develop a Time sheet project.
Abstract:
employees log-in and log-out time has to be entered,hours worked on a particular project has to be entered,status of the projects should be managed,personnel information of the employee has to be maintained,payroll report has to be prepared with the information.
Can anyone guide me on this.
Thanks in Advance
|
|
|
|
|
Take a look at the "Employee Starter Kit" and the "Time Tracker Starter Kit"
Your question is rather broad. You'll need to create a database and a GUI - but most off all, you'll need to define some specifications. Where are the employees names' stored? Are you going to retrieve them from an Active Directory? Or do they sign-in in your application? What information is expected in the payroll report? Do they have to include special rates for working in the weekends?
Lots of questions, hope they help to get you started.
I are troll
|
|
|
|