[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi all I am using the treeview click event , in order to get the current node with TreeView1.GetNodeAt
I need the mouse click x,y location
probelm is the treeview click event wont fire when I add code to the mouse down event.
what am i doing wrong ...
0
Amazon Web Services
LVL 12
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

I have several check boxes. When checkbox1 is selected, it retrieves the data based on the condition checkbox1. When checkbox2 is selected, it retrieves the data based on the condition checkbox2.
In my current situation, I have to call each time for the check box. Is there any way to bind the data only once for all of the  check boxes instead of one by one. Here is the code for checkbox1
Sub Check1_Clicked(sender As Object, e As System.EventArgs)
 


If checkbox1.Checked = true then
 
Dim strSQL

strSQL = "SELECT * FROM products WHERE XXXX "  
 

call openDB()	
					
					Dim DBAdapter As OdbcDataAdapter
					Dim DBDataSet As DataSet
					Dim DBTable As DataTable
					
					
					DBAdapter = New OdbcDataAdapter(strSQL, connTemp)
					DBDataSet = New DataSet()
					DBAdapter.Fill(DBDataSet, "SearchResults")
					
													
					
					dg.dataSource = DBDataSet
					dg.databind()
					
				
					

			
		call CloseDB()		
		
				
		
End sub	


<asp:DataList ID="dg">

                                   <ItemTemplate>
								   
							

 

<table> 

      <tr>
		<td> <a href="('<%=product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">

</td>
	</tr>
  

	
</table>
					

</ItemTemplate>
									
</asp:DataList>

Open in new window


Here is the checkbox2 almost duplicate checkbox1.

 Sub Check2_Clicked(sender As Object, e As System.EventArgs)
 


If checkbox2.Checked = true then
 
Dim strSQL1

strSQL1 = "SELECT * FROM products WHERE XXXX "  
 

call openDB()	
					
					Dim DBAdapter1 As OdbcDataAdapter
					Dim DBDataSet1 As DataSet
					Dim DBTable1 As DataTable
					
					
					DBAdapter1 = New OdbcDataAdapter(strSQL1, connTemp)
					DBDataSet1 = New DataSet()
					DBAdapter1.Fill(DBDataSet1, "SearchResults")
					
														
					
					dg1.dataSource = DBDataSet1
					dg1.databind()
					
				
					

			
		call CloseDB()		
		
				
		
End sub	


<asp:DataList ID="dg1">

                                   <ItemTemplate>
								   
							

 

<table> 

      <tr>
		<td> <a href="('<%=product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">

</td>
	</tr>
  

	
</table>
					

</ItemTemplate>
									
</asp:DataList>

Open in new window


Thank  you!
1
I have a small image on the right with scroll, when users click the small image, it will display a bigger image and when users click the big image, it will enlarge the image. When users click the large image. On the bigger image, there is a button link. When users scroll select the first image, the button link will direct the user to a new link page with this selected image.
0
I have a datalist.

1. When users mouse over the image, it shows the quick view(the quick view is stylish with background and bolded)
<img src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg" title="Quick View"/>

Open in new window


2. when user clicks the hyperlink, it  pops up the window and grays out the background page,
<a href="javascript:Openpopup('product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">

Open in new window


Currently I have made the pop up window work, but I cannot gray out the background page. I can add the title "Quick View", but I cannot style it.

3. Here is code I currently work on.
<script language="javascript" type="text/javascript">
function Openpopup(popurl)

{
	
	 var width = 500;
      var height = 500;
	   var top = parseInt((screen.availHeight/2) - (height/2));
	  var left = parseInt((screen.availWidth/2) - (width/2));
winpops = window.open(popurl,"","width=500, height=500, left="+ left + ",top=" + top + ",screenX=" + left + ",screenY=" + top)



	
  </script>  




<asp:DataList ID="dg"  runat="server" HeaderText="" HeaderStyle-BackColor="#fff" HeaderStyle-ForeColor="#FFFFFF" HeaderStyle-Font-Bold="true">

                                   <ItemTemplate>
								   
	

<table>

      <tr>
		<td> <a href="javascript:Openpopup('product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">
<img src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg" title="Quick View"/></a> 

</td>
	</tr>

</table>
					

									       
					          </ItemTemplate>
									
</asp:DataList>

Open in new window

0
I open reports of my project in internet explorer which are being made from string. Now i need to bifurcate my reports by detecting the new page so that margin could be set for each and every page.

In other words i wish to add multiple pages in a report but if my page has less data then i need to start the next page.

I am using vb.net windows application.

Thanks a ton in advance.
0
How do I do EagerLoading of this object
Public Class Person 
    Public Overridable Property personId As Integer
    Public Overridable Property nameType As String

   Public Overridable Property Names As IList(Of PersonNameType)

End Class

Public MustInherit Class PersonNameType
    Public Overridable Property personId As Integer
    Public Overridable Property nameId As Integer

    <ForeignKey("personId,personGuid")>
    Public Overridable Property Person As Person
    <ForeignKey("nameId,nameGuid")>
    Public Overridable Property Name As Name

End Class

Open in new window


I tried doing this but the navigation properties (Person/Name) of "Person.Names" is not getting filled. I mean when I drill into the Person.Names and one of the collection item the personId/NameId has data but the Person/Name properties has nothing. How do I fill that data in?
0
Right now I have an export file being saved with a unique barcode that is attached to the export file. I would like to know how I can add a unique month and year to the file but if I have multiple data collected in the same month I would append that data until a new month.


For Each export In pFile.Exports
If newDir = String.Empty Then
If export.addVariableExportUniqueVIN Then
exportFile = New FileInfo(newDir & "\" & export.ExportName & ScannedBarCode & export.ExportExtension)
Else
exportFile = New FileInfo(newDir & "\" & export.ExportName & export.ExportExtension)
End If
end if
next

Open in new window

0
My web page has the function to create 40 different pie charts for 40 different machines and their activity and display them after loading. However, I noticed that by doing so the page loading is much longer, takes about 30 seconds to finish loading.

At first I thought it was my SQL to get the data for 40 machines was the cause. But after copying it from the code and testing it, that was not true. Also, the page loads faster when I set my page to create a single pie chart, so I'm likely to assume that the large sum of pie charts to create is the cause for the slowdown.

 Sub draw_chart1() 'All Machines

        Dim check1, check2, fi, cnt

        Dim sql
        Dim myConnectionString As String = "Provider=SQLOLEDB;" & SQLDB_pp.ConnectionString
        fi = 0
        cnt = 0

        PlaceHolder1.Dispose()
        PlaceHolder2.Dispose()
        'Get all model
        Dim query1 As String = String.Format("SELECT DISTINCT A.MacID FROM dbo.tblMachine A LEFT JOIN  dbo.tblDataHdr b on a.MacID = b.MacID where DayID between '" & TextBox1.Text & "' AND '" & TextBox3.Text & "' ORDER BY A.MACID")
        Dim dt1 As DataTable = GetData(query1)
        For Q As Integer = 0 To dt1.Rows.Count - 1
            'For Q As Integer = 0 To 1
            check1 = dt1.Rows(Q)(0).ToString()

            Dim query As String = String.Format("SELECT Z.MacID, Z.EventName, ISNULL(DIFF,0) AS DIFF FROM (select distinct MacID, EventName from dbo.tblMachine a  join (SELECT DISTINCT EVENTNAME FROM

Open in new window

0
I am migrating vb6 project to vb.net. there are variant type arrays that I migrated as object types.
having this code line I get the error: Operator '=' is not defined for type 'DBNull' and type 'Integer'
                    If arrY(13, X) = gloT And (CBool(arrY(18, X)) = True Or (CBool(arrY(18, X)) = False And arr(65, X) = 100)) Then  
arr(65, X) has a null value . If I cannt initialize it to 0 how can I avoid the exception?
0
Hi,

I have this webrequest looking like this:

 Public Sub SendFile(ByVal filename As String)
            coRequest = CType(WebRequest.Create(sURL), HttpWebRequest)
            coRequest.ProtocolVersion = TransferHttpVersion
            coRequest.Method = "POST"
            coRequest.ContentType = "multipart/form-data; boundary=" & BeginBoundary
            coRequest.Headers.Add("Cache-Control", "no-cache")
            coRequest.KeepAlive = True
            Dim strFields As String = GetFormfields()
            Dim strFileHdr As String = GetFileheader(filename)
            Dim strFileTlr As String = GetFiletrailer()
            Dim info As FileInfo = New FileInfo(filename)
            coRequest.ContentLength = strFields.Length + strFileHdr.Length + strFileTlr.Length + info.Length
            Dim io As System.IO.Stream
            io = GetStream()
            WriteString(io, strFields)
            WriteString(io, strFileHdr)
            Me.WriteFile(io, filename)
            WriteString(io, strFileTlr)
            GetResponse()
            io.Close()
            coRequest = Nothing
        End Sub

Open in new window


The GetResponse sub looks like this:
Public Overridable Sub GetResponse()
            If coFileStream Is Nothing Then
                Dim stream As Stream
                Dim response As WebResponse

                Try
                    response = coRequest.GetResponse()
                Catch web As WebException
                    response = web.Response
                End Try

                If response IsNot Nothing Then
                    stream = response.GetResponseStream()
                    Dim sr As StreamReader = New StreamReader(stream)
                    Dim str As String
                    ResponseText.Length = 0

                    For Each str In sr.ReadLine
                        ResponseText.Append(str)
                    Next

                    response.Close()
                Else
                    Throw New Exception("MultipartForm: Error retrieving server response")
                End If
            End If
        End Sub

Open in new window


The coRequest.ContentLength is 100507 and everything seems ok, but I get this error:
you must write contentlength bytes to the request stream before calling begin getresponse

Open in new window


I do the exact same in C#:

Open in new window

0
Microsoft Azure 2017
LVL 12
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I have these 2 functions "Add" is a test which works to add the data to the database. It works as expected but "Create" does not. Could anyone help me to figure out why.

Thanks

    Public Function Add(ByVal itemToAdd As TObject) As TObject
        Dim addedItem As TObject = DbSet.Add(itemToAdd)
        dbContext.SaveChanges()
        Return addedItem
    End Function

    Public Overridable Function Create(t As TObject) As TObject Implements IRepository(Of TObject).Create
        Dim newEntry As TObject = DbSet.Add(t)
        dbContext.Entry(t).State = EntityState.Added
        If Not shareContext Then dbContext.SaveChanges()
        Return newEntry
    End Function

Open in new window

0
Hi All,

I have many SP that have to create on the fly.

How could I :

1. Call the SP function by just passing its function name in string.

     Public Shared Sub Create_Stored_Procedure(strFunctionName As String)

       ' strFunctionName  = Create_ERV_SP_Get_Kas_Voucher

         call strFunctionName

    End Sub

    Public Shared Sub Create_ERV_SP_Get_Kas_Voucher()
   End Sub

2. Call all Create procedure exist in the class.

Thank you.
1
Hi All,

I have a sub/function like below.

Public Class clsCreateInventoryStoredProcedure

    Private sbdSQLCommand As New System.Text.StringBuilder

    Public Shared Sub Create_ERV_SP_Get_Kas_Voucher()
    End Sub

End Class

Open in new window


How could variable sbdSQLCommand  visible to Create_ERV_SP_Get_Kas_Voucher ?

Thank you.
0
Hi all.

I have a Windows form in vb.net that allows the end user to drag an Outlook email and drop it into a datagridview control, it save the recipients, subject line, email body into a SQL Server table and if the email has any attachments it imports the attachments into a shared network folder. We've been testing it for a couple of days now and it's working great but we're running into an issue where it'll download/import the attachments in the email but if the email has a company logo in the email signature it also brings it in. Is there a way to skip these type of email signature files? So far, they've been jpeg and png files sometimes 2KB, 11KB, 64KB not big files but don't want them to be imported.

I was thinking maybe not importing jpeg, png files less than 100K or something, but maybe there is an image file that we need to download/import that would otherwise be skipped.

Any advise is greatly appreciated. Thank you in advance.
0
I have a VB.net windows form. The form has a panel control on the top of the form, and a panel control on the bottom of the form. In the middle part of the form is a split container. The upper container and lower container both contain DataGridView controls. Everything works fine. Now if I resize the form to a very small form, the scroll bars will display in my grids as desired.
However when I scroll the bottom grid's vertical scroll bar down all of the way, there is a small gap of the bottom of the DataGridView which is showing. This isn't the last row of the grid, but I guess it is the default footer?

How can I get the scroll bar to scroll all the way down to show the last pseudo footer row? Attached are the screen snapshots of before and after the Grid is resized. I drew a red arrow to point to the pseudo footer which I am talking about.
Attached are my GridView files, and I renamed them as text files, in case someone wants to rename them correctly and inspect the code.

Before Grid is resizedAfterResizing.png
Form1.Designer.txt
Form1.Designer.txt
Form1.resx
0
3. What function/process could you use to combine two datasets/tables together (assume
the tables have the same number of columns and data types?
0
Hi,

I need to upload a file with a webrequest and combine it with some other form data in the request. Today my post request looks like this:

  Protected Function PostData(ByRef url As String, ByRef POST As String, ByRef Cookie As System.Net.CookieContainer) As String
        Dim request As HttpWebRequest
        Dim response As HttpWebResponse
        request = CType(WebRequest.Create(url), HttpWebRequest)
        request.ContentType = "application/x-www-form-urlencoded"
        request.ContentLength = POST.Length
        request.Method = "POST"
        request.AllowAutoRedirect = False

        Dim requestStream As Stream = request.GetRequestStream()
        Dim postBytes As Byte() = Encoding.ASCII.GetBytes(POST)
        requestStream.Write(postBytes, 0, postBytes.Length)
        requestStream.Close()
        response = CType(request.GetResponse, HttpWebResponse)
        Return New StreamReader(response.GetResponseStream()).ReadToEnd()
    End Function

Open in new window


The string post (in request.ContentLength)  now contains this form-data:
"access_token=xxyyzzz"

Open in new window


Now I want also to add this form data parameters:
file (a pdf file to upload)
recipient_email (string value)
recipient_name (string value)

How do I need to alter the PostData function to be able to post both the file and the string data in the webrequest?

Thanks for help!

Peter
0
(Object reference not set to an instance of an object)

The following code (sometimes) give the above error only if the file is a (multi page tiff file with a large number of pages)  e.g.  400 pages or 500 pages. Not on a specific page.
and when I check     PictureBox1.Image     I find it = null!
If I reRun my software it works fine on the same page that it stopped on.
I feel it is something related to memory   (e.g.   executing the next line before full load .....)
Any help is appreciated.

PictureBox1.Image = Image.FromFile("C:\ImgFolder\ImageName.tif")
Dim NoOfPages As Long = PictureBox1.Image.GetFrameCount(Imaging.FrameDimension.Page)

For J = ImagePageFrom - 1 To ImagePageTO - 1
       PictureBox1.Image.SelectActiveFrame(Imaging.FrameDimension.Page, J)    'the error is on this line
       PictureBox1.Image.Save("C:\ImgFolder\ImageName.Gif", Imaging.ImageFormat.Gif)
Next
PictureBox1.Image = Nothing
0
i have used the linq code like the example below to construct a list of customers with the respective value,

Dim bunds As IEnumerable = (From dr In duse _
                     Group dr By a = dr.Field(Of Decimal)("msisdn") Into grp = Group Select New With
                            { _
                                .msisdn = a, _
                                .data_bytes_bundle = grp.Sum(Function(x) If(x.Field(Of Decimal)("bonus") = 1, x.Field(Of Decimal)("byts"), 0)),
                                .data_bytes_bonus = grp.Sum(Function(x) If(x.Field(Of Decimal)("bonus") = 2, x.Field(Of Decimal)("byts"), 0))
                            }).ToList

I have three list which i want to put into a single collectio using linq, it is failing at  o.msisdn with massage
Object variable or With block variable not set.

 Dim result = (From c In bunds
             Group Join o In core
             On c.msisdn Equals o.msisdn Into co = Group
             From o In co.DefaultIfEmpty() Join p In pcrf On o.msisdn Equals p.msisdn
             Select o.msisdn, o.data_bytes_bundle, o.data_bytes_bonus, o.data_bytes_core, p.byt_pcrf, p.byt_pcrf_bon).ToList

I am failing to get out of this
0
HTML5 and CSS3 Fundamentals
LVL 12
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Dear Experts

I have the code below
But in the last query that starts with "  Dim bund As IEnumerable" it is complaining "wallet_type_cd is not in datatable bund",  it is true it is in datatable wallets

How do i point to datatable wallets;

Thank you

  odadp = New OracleDataAdapter("select msisdn_nsk as msisdn, regexp_substr(flex_3_txt,'[^~]+',1,1) as byts, ded_acc_id from " & _
                                      " stg_cdr.cs5_ccn_wmx_da where date_key = 20180801 " & _
                                      " AND (REGEXP_SUBSTR(FLEX_3_TXT,'[^~]+',1,1)) <> 'X' " & _
                                      " AND (REGEXP_SUBSTR(FLEX_2_TXT,'[^~]+',1,7)) <> 'X' " & _
                                      " AND (REGEXP_SUBSTR(FLEX_2_TXT,'[^~]+',1,7)) IS NOT NULL  " & _
                                      " AND (REGEXP_SUBSTR(FLEX_2_TXT,'[^~]+',1,13)) = '3333' and rownum <= 10000", conn)
        odadp.Fill(udat, "bund")

        odadp = New OracleDataAdapter("select wallet_type_cd, wallet_cd,wallet_key from bib.dim_wallet", conn)
        odadp.Fill(udat, "wallets")

        Dim wallets As IEnumerable = (From dr In udat.Tables("wallets").AsEnumerable() Select dr).ToList

        Dim bund As IEnumerable = (From dr In udat.Tables("bund").AsEnumerable() Join wallet In udat.Tables("wallets").AsEnumerable() _
                                  On dr.Field(Of String)("ded_acc_id") Equals wallet.Field(Of String)("wallet_cd")
                     Group dr By a = …
0
Below vbscript code (.VBS)  changes Date format of one of the date column (Date)  from to "mm/dd/yyyy"  to "dd/mm/yyyy" . when saved to Excel.


Row Number|Row Action|Department|Date
123456          |Insert          |Airlines         |05/12/2016
3456              |Update       |Engineering |10/31/2014
234234         |Insert          |Arts                |2015
452435         |Insert          |Design           |2016


' Define constants
Const cExcel7 = 51
Const xlContinuous = 1
Const xlEdgeBottom = 9
Const xlEdgeLeft = 7
Const xlEdgeRight = 10
Const xlEdgeTop = 8

' Create file system object
Set objFSO = CreateObject("Scripting.FilesystemObject")

' Files to work woth
strInputFile = objFSO.GetAbsolutePathname("C:\Users\sktneer\Desktop\Input.txt")
strInputExcelFile = objFSO.GetAbsolutePathname("C:\Users\sktneer\Desktop\Input.xlsx")
strOutputFile = objFSO.GetAbsolutePathname("C:\Users\sktneer\Desktop\output-23-10.xlsx")

' Read text file into array
With objFSO.OpenTextFile(strInputFile, 1)
    arrInput = Split(.ReadAll, vbNewLine)
End With

' Start Excel, create a new worksheet
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objexcel.Application.SheetsInNewWorkbook = 3
Set dwb = objExcel.Workbooks.Add
Set objSheet = dwb.Worksheets(1)

' Initialize row index
intRow = 0

' Process each line of input file
For Each strInput in arrInput

    ' Skip all blank lines
    If strInput <> "" Then
        …
0
Hi All,

I have a key from BigInt Identity to UniqueIdentifier.

The problem is not all database change, some server are not changed yet.

  sbdSQLCommand.AppendLine("SELECT")
                sbdSQLCommand.AppendLine("ID")
                sbdSQLCommand.AppendLine("FROM TDPOJUAL")
                sbdSQLCommand.AppendLine("WHERE Nomor_OA = @Nomor_OA ")
                sbdSQLCommand.AppendLine("AND BarangCode = @BarangCode ")

                cmdSQLCommand.CommandType = CommandType.Text
                cmdSQLCommand.CommandText = sbdSQLCommand.ToString

                cmdSQLCommand.Parameters.Clear()

                cmdSQLCommand.Parameters.AddWithValue("@Nomor_OA", txtNomor_OA.Text)
                cmdSQLCommand.Parameters.AddWithValue("@BarangCode", dtRow("BarangCode"))

                HideKeyTDPOJUAL = cmdSQLCommand.ExecuteScalar()

                dtRow("IDDetailSO") = HideKeyTDPOJUAL

The  variable HideKeyTDPOJUAL is GUID at the moment.

How could I code it to make it work for both BigInt and UniqueIdentifier ?

Thank you.
0
A SQL SP returns the message ex.Message = "Conversion from type 'DBNull' to type 'String' is not valid." Turns out that putting a watch on cmd.Parameters the watch states error BC30456: 'Paramete' is not a member of 'SqlCommand'.      Cannot reason why this is so. The parameter is created and added to command.parameters. If a string literal is used it works. Thank you for any help.

 Dim cmd As New SqlCommand("[HTS].[TaskCompleted_SELECT_CompletedTasks_02_USES HortDoc_ID]") With {
                .CommandTimeout = 60,
                .CommandType = Data.CommandType.StoredProcedure
            }

             Dim HortDoc_ID = New SqlParameter With {
                .Direction = ParameterDirection.Input,
                .DbType = DbType.String,
                .Size = 12,
                .ParameterName = "@HortDoc_ID",
                .Value = g_HortDoc_ID.ToString,  'doesn't work
                .Value = "28" 'works
            }            

cmd.Parameters.Add(HortDoc_ID)

            Dim conn As New SqlConnection(mConnectionStrings.ConnHortDB)
            conn.Open()
            cmd.Connection = conn

            Dim str As String
            str = cmd.ExecuteScalar
            Return str
            conn.Close()

Open in new window


ALTER PROCEDURE [HTS].[TaskCompleted_SELECT_CompletedTasks_02_USES HortDoc_ID]
(
	@HortDoc_ID	as varchar(12)
)
AS

declare @objcursor as cursor 
 
declare 
    @vsql       as nvarchar(max)
    ,@vquery    as nvarchar(max)
    ,@id        as int
    ,@value     as varchar(50)
    
DECLARE @list varchar(1000)
DECLARE @listTemp varchar(100)
DECLARE @item varchar(300)

set @vquery = 'SELECT DISTINCT Task_CD from HTS.TaskCompleted WHERE HortDoc_ID = ' +  @HortDoc_ID
.
.
.

Open in new window

0
Good morning, I have a quick question about lists. I have multiple List(of FileInfo) that searches for employee paperwork. Why? I need to know what files are turned in and then iterate through the schedule database to find missing paperwork (check days worked vs paperwork turned in (Dates) to find information). Problem: If I create a list for each employee that holds the missing paperwork dates, can I place each list into 1 container and then iterate through the big container to retrieve those dates to generate a report or am I making this too complicated??? Each Date in each container goes to a specific listbox so I can see individually who is turning in late work. Any advice would be great, thank you!


                   
Dim Provider1 As New List(Of FileInfo)
                    Dim Provider2 As New List(Of FileInfo)
                    Dim Provider3 As New List(Of FileInfo)
                    Dim Provider4 As New List(Of FileInfo)
                    Dim Provider5 As New List(Of FileInfo)
                    Dim Provider6 As New List(Of FileInfo)
                    Dim Provider7 As New List(Of FileInfo)
                    Dim Provider8 As New List(Of FileInfo)
                    Dim Provider9 As New List(Of FileInfo)
                    Dim Provider10 As New List(Of FileInfo)
                    Dim NewFileInfo As New FileInfo(newname)
                    For Each Item In DirectoryList ' container holds directory information for each employee file 

Open in new window

0
I am looking to copy and paste data from one xlsx sheet to a new excel sheet using VBScripts . Could please some one help me using Vb script to paste exact contents from
excel-input.xlsx to a new excel excel-output,xlsx on sheet2   and rename sheet2 to DataSet.

Here is the

Excel-Input.xlsx
Name      age      gender      department      year
don                23      male      computer      2010
ptalakes       24      female      maths              2015
chang      28      male      arts                2016
prag      29      female      science              2018
tom               26      male      arts                      2017
john      27      female      sports              2018
simon      22      male      arts                      2018

Excel-Output.xlsx  (Rename sheet2 as data )
Name      age      gender      department      year
don                23      male      computer      2010
ptalakes       24      female      maths              2015
chang      28      male      arts                2016
prag      29      female      science              2018
tom               26      male      arts                      2017
john      27      female      sports              2018
simon      22      male      arts                      2018
Excel-input.xlsx
Excel-Output.xlsx
0

Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,