i made this program some time ago. it finds all numerics in an excel program and changes their formatting and it works ok. [code] my problem is, there are some alphanumeric values where i need to change the formatting of the number part of the cell example: [code] but it gives me an "Object reference not set to an instance of an object." error is there another way to solve my problem?
i have this button which i add in row of data however, it give me error, l me why is the splitItems(0).ToString cause error, how should i get that value to store in the database
Protected Sub Button2_Click(sender As Object, e As System.EventArgs) Handles Button2.Click Dim rowIndex As Integer = 0 Dim sc As New StringCollection()
Given a list of objects, I'd like to print a string version of them just in case the object.ToString() result is a relevant string.By that I mean I don't want to get things like:
I think that my previous post wasn't what I should have been asking. I think my issue has to do with Convert.ToString in my code I have this 3 times, I have no errors while writing the code, only when I debug it I get the error message "input string was not in correct format"
1. What's the difference between ToString and ToString()? (i do know that ToString method is to cast numeric values to string but don't know how to get it to work)
2. Why do i need XML comment feature? is it necessary?
I am using VS .net 2003 and developing a program that calls Excel. The development computer only has Excel 2003, and the target machine only has Excel 2007. Would it be possible to install Excel 12 Object Library in the development computer without installing Excel 2007?
I'm trying to upgrade a VB6 app to VB 2008. I have read the article in the tutors corner about automating Excel from VB but I cannot get it to work. Heres what I have done:
1) set a reference to the Microsoft Excel 12.0 Object Library
2) Added "Imports Excel = Microsoft.Office.Interop.Excel" to the top of the module
3) in a routine I have added: Dim X As New Excel.Application Here's where I get an error: Error 75 'Application' is ambiguous in the namespace 'Microsoft.Office.Interop.Excel'.
Dim exlapp As New Microsoft.Office.Interop.Excel.Application Dim xlWorkBook_new As Microsoft.Office.Interop.Excel.Workbook Dim strOriginal As String strOriginal = Server.MapPath(Request.ApplicationPath & "/Attachments/") & "abc.xls" xlWorkBook_new = exlapp.Workbooks.Open(strOriginal)
The code hangs in the last line. It works fine in the development environment. i deployed in windows server 2000 ,where I get this issue. the browser goes half way and throws the below exception after some time
[Code]...
I have set the identity impersonate to true in web config. This should be mostly an access rights issue.I have even provided access rights for the "everyone " user in the excel file and as well for the interop component. Please post ur valuable comments.
I'm trying to create a pivot table by opening an Excel file from my drive.But I'm receiving the error saying "Object reference not set to an instance of an object".[code]
Basically I've coded an Excel 2007 project in VB.NET 2010 that allows you to create charts with a fair amount of interactivity. I want the user to be able to save and reopen this workbook and still have that interactivity in any already-created charts, so they don't have to re-create them.
When I create the charts, I use Sheet1.Controls.AddChart(...), which returns a Microsoft.Office.Tools.Excel.Chart with which I can handle events and such. However, when I reopen the file and look through the Sheet1.Controls collection, there are no Chart objects. Accessing the charts through Sheet1.ChartObjects.Chart gives me Interop Charts, when I need the Tools Charts.
i am using VB.net 2003 and i am trying to get the number of rows of a dataset from form1 into form2 in order to use it for something else and i am getting the error"System.NullReferenceException occured...Additional information: object reference not set to an instance of an object"...my code is like this:in form1:Public x as integer= me.dataset.table.rows.count here it gives me the error
I am getting this error when I try to print my report. Here is my print code.
Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click Dim Print_Dialog As New PrintDialog
[code].....
Here is my error: System.NullReference Exception: Object reference not set to an instance of an object.
i am trying to allot a cell value to another cell value basing on some conditions & finally delete one column.my code is as fallows
Dim i, x As Integer i = 0 x = Me.DataGridView1.Rows.Count[code]....
error i am getting is : Object reference not set to an instance of an object.it is extremely surprising for me the same code has worked nice for me but why & how the same line of code is generating this error.
The issue is when I try to add a new item to the ArrayList with the following code, it gives me an error:
vb Private Sub btnLabelAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLabelAdd.Click Dim result As String = InputBox("New Filter Label:", "Label List")
[CODE]................
Object reference not set to an instance of an object.
I'm not really sure what I'm supposed to be doing with this. It's a new setting I just added and it's empty, so I'm not sure if that has anything to do with it or not. Anyone know what's going on and what needs to be done to get it to accept a value and not want to be "initialized"?
I have recently gotten my hands on a free, open-source IMAP connection API.So far, I have been successful in creating a connection to one of my accounts.Where I'm getting stuck is retrieving folders and/or emails from those folders.Does there happen to be anyone here that is familiar with this API, or even Gmail (particularly the folder structure for IMAP)?
If not, here is a link to the DLL that is listed on sourceforge and the company's website that created it (if you feel like testing):
Koolwired Sourceforge - Koolwired API
I have created a test account so feel free to use the code below without worrying about username/password issues; I'll just delete it when I'm done with it.Here is the code I have made so far for making a connection:
Dim gSession As New Koolwired.Imap.ImapConnect("imap.gmail.com", 993, True) Dim gAuthenticate As New Koolwired.Imap.ImapAuthenticate(gSession, "imap_test@serysoft.com", "imap_test") Try
[code]....
When I run that code, I get an error that states:System.NullReferenceException: Object reference not sent to an instance of an object. (The bold line in the above code).
Now, I'm not sure exactly what that means. Does that mean it tried to access the server and "INBOX" doesn't exist so it gets returned a NULL value? Or is it possibly the coding itself?Maybe the Gmail folder system is weird due to the fact they use labels (even though from what I have read online, the labels act as the folders in the IMAP system).
Protected Sub CompetenciesButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CompetenciesButton.Click Dim con As String = WebConfigurationManager.ConnectionStrings("foo").ToString()
I am completely new to ASP.NET and VB as well as C#. I am trying to add customers to a contact list out of a DB. Then the list can be referenced to call them up. But when I try to run it I get System.NullReferenceException: Object reference not set to an instance of an object. In line 19.
Here is my code:Page 1 is default page...it connects to the database and grabs the contact information and allows me to select the current contact and add them to a listbox on a separate page:
Imports System.Data Partial Class _Default Inherits System.Web.UI.Page
[code]....
The error occurs on line 19 (For Each customerEntry As DictionaryEntry In Customer) in the second set of code from the default2 class.
I am making an application that takes information from the textboxes and saves it to a sequential access file or text file named checkfile.txt. I have the textfile in the proper location within the project folder.
I am getting an error stating Object reference not set to an instance of an object.
I'm having this problem with my code and cannot seem to get past it although it was working fine before. The error is "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object." The code is:
CODE:
I am trying to get information to be pulled out of a database and show in text boxes on another form (frmviewsdets). The error occurs when it gets to the line frmviewsdets.txtsnumber.Text = rdr("StudentNumber") and even when a breakpoint is applied there it just moves on to the next and so on.
I have tried to show frmviewsdets before I pull the data out of the database beut I get the same message.
I'm finishing up working on the high score list of my Jeopardy game. The only problem that I'm running into is when I try to start from scratch without a textfile in the Debug folder.I get a NullReferenceException was unhandled - Object reference not set to an instance of an object. I get this message with the line If (myPlayers.Length - 1) > 2 Then just before I start to compare the scores and reorder the list by score if necessary.I already declared myPlayers as an array of structures in the beginning of the form.
Private myPlayers() As Players
It writes the name and score to the file, but then gives me that error. My goal is to only fill the file with the three players names and their scores.I figured since the file doesn't exist, I'm doing something in that specific code that effects my reference to myPlayers but I can't figure out what exactly. I tried adding
If (myPlayers.Length - 1) > 2 AND File.Exists("highScore.txt") Then
but its still giving me the error.
'read in scores, add scores to file or create new file if neccessary If File.Exists("highScore.txt") Then Dim InputFile As StreamReader
The latter is giving the error "Unable to cast object of type 'Object' to 'CTest'." when used:
Dim thestack As CTest() = testdatabase.getStack Where testdatabase.getStack simply returns stack(); Public Function getStack() As Object() Return stack End Function
This fixes it, but it's not ideal (for me personally):
Dim thestack As Object() = testdatabase.getStack
So if I could keep the variable as-is (Public stack() As Object) and then do something along the lines of class.stack() = CTest I should be able to do Dim thestack As CTest() = testdatabase.getStack because the object array will programmatically have changed from Object to CTest.
I am coding in vb.net. At times the data is empty/null this is due to user's input into the db.i will like to bypass it, however i get no luck.here is snippet of my code:
If hct.mydbvalue.name IsNot Nothing Then dr("mydbvalue") = hct.mydbvalue.name End If
I still get an error: System.NullReferenceException: Object reference not set to an instance of an object.is there a way if it is a null value to not do anything?
When the following executes, I get the error 'NullReference Exception' - Object reference not set to an instance of an object. TestClass has Get and Set methods for the integer property TestWord.How should the following be changed to let me set TestWord in six elements of TArr?
Dim TArr(5) As TestClass For i As Integer = 0 To 5 TArr(i).TestWord = i * 10 Next
My login is working fine, but occasionally when I start to run and debug the prog, it will stop running and point to this error. This is my login page
Partial Class Admin Inherits System.Web.UI.MasterPage Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ans As String = Session("Status").ToString()