Public Sub SaveExcelFile(ByVal FileName As String)?

Nov 22, 2011

Public Sub saveExcelFile(ByVal FileName As String)Dim Excel As Object

[Code]...

that is my code. everytime i open the saved file, it says that it has a different file type and asks me if i want to continue opening it and i click yes. the data inside the excel file is only the word "Success"

View 14 Replies


ADVERTISEMENT

Public Function GetHDDFreeSpace(ByVal Drive As String) As Double?

Jul 28, 2009

ManagmentObject is not recognized!!! Help me!

Imports System.Management
Imports System.Management.Instrumentation
Public Class Form1

Public Function GetHDDFreeSpace(ByVal drive As String) As Double

If drive = "" OrElse drive Is Nothing Then
drive = "C"
End If

[Code]...

View 3 Replies

Addline Function - Public Overloads Sub AddTextLeft(ByVal Text As String

Dec 13, 2010

I've got question. I created this;

Public Overloads Sub AddTextLeft(ByVal Text As String, ByVal Fontsize As Decimal, ByVal Bold As Boolean)<br/>
'-- PBA / 22.08.2006<br/>

[CODE]...

View 5 Replies

VS 2008 Scan A Long String And Return Any Values That Occur Between The Tags <FileName> And </FileName>?

Jul 1, 2009

Quick query...I'm trying to scan a long string and return any values that occur between the tags <FileName> and </FileName> I've got a bit of code here to use regular expressions to return the position of the occurunces of both substrings..Just wanted to find out if there is any way to scan for both substrings within one loop (as im currently doing 2, one for the first substring and one for the 2nd) so I can use something along these lines:

ringlist = Mid(XMLRESP, (startloc + 1), (endloc - 1))
MsgBox(ringlist)

to msg box the value between the substrings...either that or another approach to return the value between the 2 substrings (it can be of variable length)

Dim patternstart As String = "<FileName>"
Dim patternend As String = "</FileName>"
Dim matchesstart As MatchCollection = Regex.Matches(XMLRESP, patternstart)

[code].....

View 3 Replies

Reference To The String In The Heap Is Passed Even When You Pass The String ByVal To A Method?

Mar 2, 2011

So strings are reference types right? My understanding is a reference to the string in the heap is passed even when you pass the string ByVal to a method.

String myTestValue = "NotModified";
TestMethod(myTestValue);
System.Diagnostics.Debug.Write(myTestValue); /* myTestValue = "NotModified" WTF? *[code].....

And what is going on under the hood? I would have bet my life that the value would have changed....

View 5 Replies

Private Sub Page_Load(ByVal S As Object, ByVal E As EventArgs)?

Jun 12, 2009

<script runat ="server" >
Dim objDT As New System.Data.DataTable
Dim objDR As System.Data.DataRow

[code]......

View 2 Replies

Passing String ByVal Into Function Without Changing Reference Value?

Jun 26, 2009

I know strings are immutable, so the minute you change a string reference's value .NET makes a brand new string on the heap. But what if you don't change the value of a string reference; rather, you simply pass it into a function ByVal -- does this operation copy the string value on the heap as well? My inclination is "no," but I'd like to confirm.

For example:
Public Function IsStringHello(ByVal test As String) As Boolean
Return (String.Compare(test, "Hello") = 0)
End Function

Calling program:
Dim myWord as String = "Blah"
Dim matchesHello as Boolean = IsStringHello(myWord)

I know passing myWord by value makes a copy of the reference to "Blah", but since I have not tried to change the string itself, would it make another copy of the string on the heap?

View 6 Replies

IDE :: Private Sub TextBox1_TextChanged(ByVal Sender As System.Object, ByVal E As System.EventArgs) Handles TextBox1.TextChanged

Jun 10, 2011

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

Textbox1 how the text box by real-time data monitoring?

View 1 Replies

Private Sub Cv7import_Load(ByVal Sender As System.Object, ByVal E As System.EventArgs)

Jan 5, 2012

I'm making this program that opens the same forder in every pc but it identifies the pc name to do it.

Public Class cv7import Private Sub cv7import_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]...

but I want it to do it with the pc's name and I'm not sure how the environment.systemdirectory works, or even if it's the right one to use. Is it the right thing to use or is there a better solution.

View 12 Replies

Getting Filename From A String?

Dec 8, 2009

I am getting a filename in a String and need to get the name from this. An example:

Dim file As String = "Hello.png"
'I need to get "Hello". One way of doing it is:
Dim name As String = file.Split(ChrW(46)).First()

The problem with this method is; What happens if the filename contains a .?

[Code]....

View 1 Replies

ByVal Sender As System.Object - ByVal E As System.EventArgs

Jan 25, 2011

Just as a secondary question, usually I reduce: -(ByVal sender As System.Object, ByVal e As System.EventArgs) to just () for most occurrences of auto-generated subroutines. Is there any harm in doing this? I cant see any reduction in performance but do get more readability.

View 8 Replies

Date String Format For Filename?

Apr 1, 2009

I am trying to make a filename something like this:

dim Test as string = "name_" + now.toshortdatestring() + ".pdf"

The datestring is like MM/DD/YYYY, which is a particularly bad filename (who want slashes in their file names??)Is there a way to format the date string differently (ie MM-DD-YYYY)?What I was trying to do is tag the file with a date so I could tell when the last time that file was generated, and also keep multiple copies around for archive purposes. Maybe there is a better way and then I dont even need this differently formatted string?

View 4 Replies

Remove The Filename And Extract Just The Path Of The OpenFileDialog.Filename Property?

Oct 17, 2010

How would I do that? Sample code is below that demonstrated that the file I opened contained the full path and file name.

I want to extract just the path and serialize that to the user.config file as a UserSetting value. Then next time the user opens the dialog box, it uses that saved path string to go immediately to the location previously used.

If openFileDialog1.ShowDialog() = DialogResult.OK Then
Properties.Settings.Default.persistConnectionType = openFileDialog1.FileName
Properties.Settings.Default.Save();

[Code].....

View 3 Replies

Check When Filename Contains A Portion Of A String In Program?

Jun 27, 2012

I have a userform in 2008 vb express edition. A part number is created from user input via a concat string. I want to then check if a certain portion of the part number exists in the existing file names in a directory. Below is a more detailed explanation.[code]...

View 2 Replies

Modifying String Containing Invalid NTFS Filename

May 6, 2009

I have a piece of code to debug. Because of unknown bugs it creates a dummy filename. I want to track all the pieces of code who fires that creates the dummy filename, so I can change the dummy file creation to a thrown exception. Since I the dummy filename is stored on a string, I plan to modify that string to contain an invalid NTFS filename, maybe containing invalid chars. Is there a reason to prefer some invalid chars over others? There are some predefined invalid NTFS filename destined to this purpose? (I may think of AUX , COM1 , LPT1 or PRN , but those names run the risk of start sending data to a port instead of throwing an exception).

View 1 Replies

FileName As String - Application Installed Randomly Locks Up

Dec 23, 2010

I have a quite simple application that is having some random locks up. It's just a few text fields that the user fill it up, 3 sets of Radio buttons, one of them with flags to chose the language and click the PDF button. The application uses iTextsharp to load a PDf template, insert the text into it, depending on the language loads some extra text from a .xml file, and depending on the radio button removes the images from the PDF, closes the pdfstamper and uses [Code] to open the file with whatever PDF application the user have installed and closes itself.

Sounds simple, but after the application is installed in the machine (never in debugging mode) it randomly locks up the application. I tried re-publish the application commenting out the Start(filename) line and the thing stopped locking. And I double checked it, re-publish with the line again and it locked after just a few attempts. [Code]

View 1 Replies

Get The FileName For The Proces.Start(FileName) Method?

May 27, 2009

I have a Listview on my form with different files. I can selet a file en open it with the proces start method. To open the file i use the OpenFileDialog method and select the filename. This work very good. With the code below.

My question is if there is a method to get the selected file without using the OpenFileDialog Box. So when i dubbelclick the selected file the proces will start with open the selected file. Something like:

proc.StartInfo.FileName = Me.SelectedCell.FileName
instead of proc.StartInfo.FileName = Me.OpenFileDialog1.FileName

PS) May be i can preduce the Filename using the OpenFileDialog method on the background.

Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

[Code]....

View 8 Replies

Transform An Address Like File:///d:filename.ext In A D:filename.ext

Jun 26, 2009

how do you transform an address like "file:///d:filename.ext" in "d:filename.ext"

without dirty string manipulation??

View 4 Replies

Cannot Use "Byval" String To Connect With Strings

Oct 20, 2009

I'm working on a class that creates a communication between multiple computers. When a client connects he has an ID which is a string.Now I need to show the user ID in a text box and write "SomeUser Connected!" (Replace SomeUser with the ID), this is the sub[code]...

View 5 Replies

Error: Argument Not Specified For Parameter 'XLSFile' Of 'Public Sub New(XMLFile As String, XLSFile As String)'

Feb 23, 2011

I am not the one who developed this tool, it's the previous programmer and they gave the project to me to update it however, when I try to run the application in my local computer I am getting this error: Argument not specified for parameter 'XLSFile' of 'Public Sub New(XMLFile As String, XLSFile As String)'.

The error points to the code below in bold letter:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Zym.ConnectionString = Web.Configuration.WebConfigurationManager.ConnectionStrings("cnworkload").ConnectionString
'Dim cn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(Zym.ConnectionString)
'Dim DA As New System.Data.SqlClient.SqlDataAdapter("SELECT * FROM SUMMARY_WORKLOAD", cn)

[code].....

View 11 Replies

Creating A Public String Object

Jul 15, 2011

i'm having problems creating a public string varialble in a class or module. i am going to be refering to it in many forms so this way i only will have to change the text of the string once and not on each form.Currently when i try to use the new string variable as an object variable from another form, it isnt showing up as an object i can reference. [code]

View 5 Replies

Public Shared MyVariable As String?

Jun 21, 2011

Say I have an ASP solution with a Globals.vb file. Inside that file, I have this: Public Shared MyVariable As String Now say I publish this solution and make it available to Bob and Cindy.If Cindy sets (through the interface) MyVariable to 5, would Bob be able to read it? I hope not, I'm hoping this variable would be user-specific.

View 2 Replies

Convert A String To Declared Public Constant

Jan 2, 2012

I have declared some constants as double in a Class

[Code]....

I'm tryingto figure out how I can get the text box to display the value of the constant with the same name? i.e 1.54186 in the example given

View 11 Replies

Get The Reference Of A Public Variable Using The String Name In Another Form?

Feb 25, 2011

I have public variables in a module. I need to get the reference of the variable by using the String name of variable in another formell me how to do this?I need something like the following code:

Dim Var1 As string
Dim sVariableName As String = "Var1"
GetReference(sVariableName).SetValue = "testing"

[code].....

View 2 Replies

Public Member 'First' On Type String() Not Found?

Mar 16, 2011

Im getting this error when trying to do anything. With all of my lines of code, what ever i try and do this occurs:

Private Sub FindQuotationforCustomer()
'Search for the Customer ID in the Quotations file.
For i = 0 To Quotationlines.Count() - 1[code].....

View 2 Replies

C# : Make A Jagged String Array A Public Property?

Mar 28, 2011

Public Property TabsCollection()() as String()()
Get
Return _tabsCollection
End Get

[code]....

but it errors saying: End of statement expected.

View 3 Replies

Custom Class With A Public Property String Array?

Jan 5, 2010

I am trying to create a property of type string array (if this is possible).....and I seem to be lost.

I tried the following, but it says "String cannot be converted to '1-dimensional array of string'" at the return

Private _strZipList As String()
Public Property strZipList(ByVal i As Integer) As String()
Get

[Code].....

View 10 Replies

Public Member 'Notesbox' On Type 'String' Not Found?

Feb 17, 2010

I have a small form that i open from several other forms with showdialog, as a little pop-up thing. Its used to sed SMS messages via an email to SMS service.Because it can be opened from several other "parent" forms i need to know which form opened it, and then i put some text in a notebox on the "parent" opening form.

Heres the code im using to open the form:

Private Sub Btn_SendSMS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_SendSMS.Click
SMSForm.TBMobileNumber.Text = Me.MobileNumberBox.Text
SMSForm.OpeningFormName = Me.Name

[code]....

View 3 Replies

Public Member 'PerformClick' On Type 'String' Not Found

Dec 19, 2011

I have a label with name "Label15" and and a button "button1" on my form.

in my code :

Label15.text = "Button1"
dim myitem = label15.text

[code].....

this code does not work...when I put it in a msg box to show the error : it appears as buton1.performclick()and if I write button1.performclick() manually ,then it does the operation.I want to trigger the perform click operation from a textbox.text. Main error is:Public member 'PerformClick' on type 'String' not found.

View 8 Replies

Public Member 'Selected' On Type 'String' Not Found

Mar 26, 2012

I'm having a bit of trouble figuring out this error and what it means. Here is the code that is throwing the error,

For Idx = 1 To cboCallType.Items.Count - 1
[b]' If cboCallType.Items(Idx).Selected = True Then ' If Item is Selected[/b]
For I = 1 To cboCallType.Items.Count - 1 ' Set Index to look at the array

Public member 'Selected' on type 'String' not found. I'm assuming this error means you can't select a String in the combobox? I always thought you could, I'm just checking to see if one of the items were selected before moving on with the code, what other way is there to accomplish this and/or what does this error actually mean and how do I go about solving it?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved