|
Hi,
i want to merge 2 cells in excel when i am Exporting data from datagrid to cells. how can i do that .please send me a reply.
i am using code like this to export data
Dim XlApp As Excel.Application
Dim XlBk As Excel.Workbook
Dim XlSht As Excel.Worksheet
Dim r As Excel.Range
XlApp = CreateObject("Excel.Application")
XlBk = XlApp.Workbooks.Add
XlSht = XlBk.Worksheets(1)
XlApp.Visible = True
XlApp.Cells(1, 2).Font.Name = "Arial"
XlApp.Cells(1,2).Font.Bold = True
XlApp.Cells(1, 2).Font.Size = 9
XlApp.Cells(1, 2).value = "Mode Of Shipment"
r = XlApp.Cells(1, 2)
r.ColumnWidth = "Mode Of Shipment".ToString.Length * 1.5
XlApp.Cells(2, 2).Font.Name = "Arial"
XlApp.Cells(2, 2).Font.Bold = False
XlApp.Cells(2, 2).Font.Size = 9
XlApp.Cells(2, 2).value = DtGenReport.Rows(0)("Item").
if the heading is large i want to merge 2 cells.
Thanks and Rgards
Anu
|
|
|
|
|
hi,
try using this statement
objExcel.Range(a1,b1).Merge
hope this works.
Nitin...
|
|
|
|
|
Why won't this code clear all of the data from the ORDERS table?
I must be missing something obvious!
thank you!
Me.DataSet1.ORDERS.Clear()
Me.DataSet1.ORDERS.AcceptChanges()
|
|
|
|
|
I have use RichTextBox in my application, i want to use many color and fonts and i want to remember.
Thanks
................
|
|
|
|
|
the vb code is :
Private Sub Command1_Click()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = 4
RichTextBox1.SelColor = vbRed
RichTextBox1.SelFontSize = 14
RichTextBox1.SelStart = 6
RichTextBox1.SelLength = 3
RichTextBox1.SelColor = vbBlue
RichTextBox1.SelFontSize = 16
End Sub
Private Sub Form_Load()
RichTextBox1.Text = "I'm From China,Welcome to My Blog,http://myfend.bokee.com"
End Sub
|
|
|
|
|
How to resize an image in VB6 ?
Luay Al-wesi
|
|
|
|
|
Hello,
I'm developing with VB.net 2. I designed a class library which contains a formular and a console application as a starter for the library. If I start the project the library shows the formular and that hangs. Did anyone know a solution for me?
vocaris
|
|
|
|
|
There's only about 10,000 reasons your app can hang. Start you app in debug mode and step through the code to try and see where it's hanging. Once it's narrowed down to that, you can ask a more specific question. Be sure to post some code where the app is hanging too.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Please help in coding my combo box.
I wanted the code below to bind to my database.
but it only got bound to the first record only.
Try
myadapter.Fill(myset, "doc_reg")
Dim mytable As New DataTable()
mytable = myset.Tables("doc_reg")
myview = mytable.DefaultView
cbodoctor.DataBindings.Add("text",myview, "lname&fname&" / "& dcode")
Catch myerror As Exception
MsgBox(myerror.Message)
End Try
Else
MsgBox("Open Conection Please")
End If
Want to concatenate three columns and bind it to a combobox. All the data in the column.
thanks.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
A much easier approach to that is concatinate the three columns as a Single column in the QUERY. Fetch and bind that column.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Dim mytable As New DataTable()
mytable = myset.Tables("doc_reg")
cbodoctor.DataSource = mytable
cbodoctor.DisplayMember = "ColumnName"
cbodoctor.ValueMember = "ColumnName"
|
|
|
|
|
My ASP.Net 2.0 web application launches a VB.Net 2005 Smart Client. How to I debug 'into' the smart client when they are separate VS 2005 Solutions ? I tried adding a 'reference' to the sc .exe but this did not seem to work.
Does anyone know how to make this work or where I can find a solution?
Many Thanks!
|
|
|
|
|
You can either setup remote debugging or if you're testing on the same machine, you can setup two Visual Studio sessions. One for your ASP.NET code and the other will have to Debug/Attach to the process launch by your browser session. It can only do that AFTER the process is launched however.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I need to determine if a number is in integer. It needs to be a whole integer and cannot be alphanumeric, or decimal. I tried isnumeric, but isnumeric still returns decimals, I need a function that will exclude decimals.
Posted by The ANZAC
|
|
|
|
|
Why not just force it to an Integer?
Dim x As Integer = CInt(myNumber)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i can't force it because i need to divide one number by another and check if it's a whole number, forcing it would defeat the purpose of determining if it's integer or decimal.
Posted by The ANZAC
|
|
|
|
|
Next time, PUT ALL THE DETAILS IN THE POST, like WHY you're doing something, or WHY you think you need to do this!! I answered your question to the specifications you put it in the original post.
If you want to find out if a number is an integer or not, simply do a little conversion:
Shared Function IsInteger(ByVal num As Decimal) As Boolean
' This will only work when num is inside the limits
' of a Long number type. That's between:
' -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807
Return CDec(CLng(num)) = num
End Function
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thankyou and i am sorry, but you don't have to be so agressive.
Posted by The ANZAC
|
|
|
|
|
Sorry man! I had the worst day at work and ended up taking it out on you! I'll try to leave work at work next time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Wow Harsh!
Post by THE ANZAC 'I need a function' (to test if a value is an integer)
reply by Dave Kreskowiak 'Why not just force it to an Integer?'
reply by THE ANZAC 'forcing it would defeat the purpose'
reply by Dave Kreskowiak 'Next time, PUT ALL THE DETAILS IN THE POST, like WHY you're doing something, or WHY you think you need to do this!! I answered your question to the specifications you put it in the original post.'
er no, you asked a new question and showed how to do that.
Sure THE ANZAC could have explained why he needed a function, but he did state that he needed one, you just assumed he was mistaken and that he didn't need a function and that he could just force it.
If you had answered his question to what specifications there were, you would have provided a function.
Not that this detracts from your point about including as much info as possible in the original post, when I have a question I shall certainly do so.
I don't want to get bawled out - forewarned is forearmed as they say.
I imagine that when you spend as much time, providing as much help, as you do, it must be frustrating to realise that you have given an answer, that with a little more information you would not have wasted your time giving.
I have written this post because I could see myself having asked a question and thinking (mistakenly) that I had provided enough information, only to find myself quite strongly rebuked. As I have said, I appreciate that it must be frustrating for you, but those of us with less experience may well not be aware that we have omitted something you perceive as obvious and vital.
|
|
|
|
|
I've apologized to him. It was not a good day for me...
Alex@UEA wrote: but he did state that he needed one, you just assumed he was mistaken
No, I didn't.
BTW: In your version, the function will only work for values with the limits of an Integer. Which is probably fine for most cases, but if there is no specification, you're making an assumption that it will work for ALL of his cases. That leads to hard to detect bugs and why I put the note in the code that I did.
Alex@UEA wrote: As I have said, I appreciate that it must be frustrating for you
The questions on CP aren't frustrating. Well, most of the time! We all know there are some people who come here asking us to write code for them and ask "What's wrong with my code?", with no explanation of what the code is supposed to do, no error messages and no code snippets. The quality of the answer is a direct reflection of the quality of the question.
My problem was that I got so frustrated with my job at work that I let it spill out here and at home. And for that, I apologize.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: BTW: In your version, the function will only work for values with the limits of an Integer. Which is probably fine for most cases, but if there is no specification, you're making an assumption that it will work for ALL of his cases. That leads to hard to detect bugs and why I put the note in the code that I did.
thank you for the pointer (of the non coding variety)
|
|
|
|
|
Use the Double.TryParse method with NumberStyles.Integer.
---
b { font-weight: normal; }
|
|
|
|
|
Private Function IsInt(ByVal value As Object) As Boolean
If IsNumeric(value) Then
If CInt(value) = CDbl(value) Then Return True
End If
Return False
End Function
|
|
|
|
|
Passing the parameter as an Object isn't recommended. This forcing boxing and unboxing operations that are quite expensive. If this function is used very frequently, this can cause serious performance issues.
It may be more code, but writing overloaded versions of this function for Decimal, Double, ..., would result in MUCH faster code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|