|
Can you show an example of the code you are using to export data to excel?
Steve
|
|
|
|
|
Hi,
i am using like this
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
|
|
|
|
|
|
I don't believe there's something like this built in. Is word order important ? The easiest way I can think to do this is as follows ( sorry, in C#, you'll need to convert it, I removed the semicolons )
string [] sr = str.Split(" ")
List<string> l = new List<string>()
foreach (string s in sr)
{
if (!l.Contains(s)) - This is something like if Not l.Contains(s) then in VB.
{
l.Add(s);
}
}
So, you turn the string into an array, you can add them to the array so long as they are not already there. An iterator to do this would be a sensible approach, it's probably a little more code, but it would be a nice solution.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
try this
Dim strAll As String = "hi man, say hi to all"
Dim strWord As String = "hi"
Dim intFirstIndex As Integer = strAll.IndexOf(strWord) + strWord.Length
Dim strNew As String = strAll.Substring(0, strAll.IndexOf(strWord) + strWord.Length)
Dim strRest As String = strAll.Substring(intFirstIndex)
strRest = strRest.Replace(strWord, "")
strNew &= strRest 'strNew="hi man, say to all"
Tamimi - Code
|
|
|
|
|
sorry, how does this help ? This works fine, if you know before hand that only one word is repeated, and which word it is.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
that sis true, thank you for correcting me .
we can replace this
Dim strWord As String = "hi" with Dim strWord As String = textbox1.text
to work around that this code is only for one repeated word.
Tamimi - Code
|
|
|
|
|
It's really cool that you're trying to help, but the OP asked for a way to find ALL duplicate words, not to have to specify them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I am a novice programmer, trying to develop a small Excel based application using VBA.
I am trying to trap the event when a shape is added to a worksheet, so that I can execute some associated code - can anyone point me in the right direction?
Thanks
|
|
|
|
|
how to create datalinklibraries in vb.net
|
|
|
|
|
With code
My answer is as in depth as your question. If you have absolutely no idea how to do something this high level, google is a better place to start.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What do you mean by "datalinklibraries"?
If you mean dynamic link libraries, there is a lot of information available, if you would just bother to look for it[^].
The questions that you have been asking in the message boards have been answered many times before, and there is plenty of information avialable. The best source for those answers is not a message board, but searching the existing information.
You are of course welcome to ask any question you like in the message boards, but unless you ask more specific questions, you will only get directed to google over and over again.
---
b { font-weight: normal; }
|
|
|
|
|
how to create datalinklibraries in vb.net
|
|
|
|
|
That depends on what your definition of a "datalinklibrary" is? I assume your talking about a Data Layer for a n-tier application?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to create delegates in vb.net
|
|
|
|
|
If you're incapable of finding the answer to this question online, or in your books, then you really have no excuse to be using a computer. If you haven't bothered to look, then you need to realise these forums are a resource best used by people who are capable of doing some research. If you can't type 'VB.NET delegate' into google, what are the odds you can even understand any explanation I may offer you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir,
I want to learn NTFS file Extentions I mean how to make programs and before that what are NTFS File Extentions .
Can u please help.
Thanks
|
|
|
|
|
A file extension is just the last part of the filename. Or are you asking about NTFS File SYSTEM extensions??
This is not something VB.NET and C# are suitable to write something in. You won't find any examples unless you write them in VC++.
You have to have at least a passing kowledge of NTFS internals just to get started. I suggest reading this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Can anyone point me in the right direction to adding a checkbox to the ListView results that are generated using ExpTreeLib, what I would like to do is have the directory listing appear in the listview control and have a checkbox next to each entry that will add the path to an array if the checkbox is checked and remove it if it is unchecked.
Any ideas?
|
|
|
|
|
U can use foreach loop to loop over all the items of Grid Control and can find the Checked Items in the list. Or other way to of doing this is use Tree view control.
Regards,
Amit Kumar
HDISM, PGDCA, MCP, MCAD, MCSD
amit_chikara2002@hotmail.com
|
|
|
|
|
Is there a VB.NET equivalent syntax to this C# code?
public class FooBase
{
public FooBase ()
{
}
}
public class Foo : FooBase
{
public Foo () : base ()
{
}
}
Edit: So there's MyBase.New(), but is that it?
|
|
|
|
|
Public Class FooBase
Public Sub New()
' do something
End Sub
End Class
Public Class Foo
Inherits FooBase
Public Sub New()
' Call the base class constructor...
MyBase.New()
' do something
End Sub
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was hoping there was something like the Constructor() : base () syntax, but I guess MyBase.New() will have to do.
Thanks for the response.
|
|
|
|
|
Hi All,
I wrote a program in vb.net and it runs perfectly on my local machine but not on network drives. The following is the error message I got when I run on network drive:
"Request for the permission of type 'System.Data.Odbc.Odbc:Permission, System.Data, Version=2.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed"
After I make some research I found following link:
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx[^]
Based on info at about link, I
1) run sn.exe in command prompt like : sn -k "r:\myprog\debug\mykey.snk"
2) opened AssemblyInfo.vb and added : <assembly: assemblykeyfile("r:\apps\tools\roscoe="" 4.0\subs\roscoekey.snk")="">
3) run progam and I got another error message saying "Unable to emit assembly: Referenced assembly 'MyLib' does not have a strong name"
MyLib is C-Sharp class library.
4) So i added AssemblyKeyFile: in AssemblyInfo.cs
5) when i run program I got other error messages saying
- "Assembly generation failed -- Referenced assembly 'Interop.Word' does not have a strong name"
- "Assembly generation failed -- Referenced assembly 'Interop.Excel' does not have a strong name"
- etc......
What do I need to do inorder to run my program on network drives like I could run on my local drives.
Thank You.
|
|
|
|
|
A network, any network, is not a trusted source for executable code. I suggest you read up on Code Access Security[^]. And, what's new[^] for CAS in the .NET Framework 2.0.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|