Jump to content
Xtreme .Net Talk

cerr

Members
  • Posts

    6
  • Joined

  • Last visited

About cerr

  • Birthday 12/18/1977

Personal Information

  • Visual Studio .NET Version
    Professional
  • .NET Preferred Language
    VB.NET

cerr's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Is there anything I can do to help debug this?
  2. I have a program were I take in data from an excel file and do some basic processing and generate an output file in Excel. The code seems to run ok, but I am not sure if I have a bug. The problem is while the application is running, I cannot open any Excel files (whether or not they are used in the code). Excel itself will load, but the worksheets associated within the file do not. So basically I see the top section (file menu, toolbars, ect) but the space were the worksheets are supposed to be does not load. I saw Gizmo's earlier post and have done the following in my code: This section reads data from excel Dim Xl As New Excel.Application() Dim Xlb As Excel.Workbook = Xl.Workbooks.Open(fileName) Dim Xls As Excel.Worksheet = CType(Xlb.Worksheets(workshtName), Excel.Worksheet) 'search for and collect data by looking for cells with flag set .... Xlb.Close(False) Xl.Application.Quit() Xl = Nothing Xlb = Nothing Xls = Nothing Here is a section of code that writes data to excel Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet xlApp = CType(CreateObject("Excel.Application"), Excel.Application) xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook) xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet) 'Insert data into excel .... xlSheet.SaveAs(qstExtractFile) xlBook.Close() xlApp.Quit() xlApp = Nothing xlBook = Nothing xlSheet = Nothing Is there a bug in my code, or is this the way VB is? I would appreciate it if anyone could shed some light on this. -Thnxs ps. Don't know if this makes any difference, but the program is not multi-threaded and rebooting seems to resolve the issue temorarily. At least until I start the app again.
  3. Hey Techno- Thanks for the pointers!
  4. Gizmo- Can u show the proper way to close the file and application in your example? Thxs!
  5. code OK, so i had *alot* more time to work on this today than what i had thought. here is my initial pass, any comments / suggestions are welcome as i'm pretty new to VB. Module Sort Public Const numDimensions As Integer = 5 Public qstArray(5, numDimensions) As String Sub BubbleSort(ByRef strArray(,) As String, ByVal numDimensions As Integer) 'This function will sort our array. It takes the 2 dim. array that was extracted 'from the excel file and the number of columns. 'Yes, this is a very slow algorithm, but this is only a prototype. This function 'can be optimized in the next release Dim intCounter, EventLoop, i As Integer Dim Temp(1, numDimensions) As String For EventLoop = 1 To UBound(strArray) For intCounter = 1 To UBound(strArray) - 1 If strArray(intCounter, 1) > strArray(intCounter + 1, 1) Then 'swap our values. seperate loops to handle the 2 dimensional array For i = 1 To numDimensions Temp(1, i) = strArray(intCounter, i) Next i For i = 1 To numDimensions strArray(intCounter, i) = strArray(intCounter + 1, i) Next i For i = 1 To numDimensions strArray(intCounter + 1, i) = Temp(1, i) Next i End If Next intCounter Next EventLoop End Sub End Module
  6. Hi guys-- I'm new to VB .net so please bare with me. I am trying to read in a range of values from an excel worksheet and sort them, eventually writting to a seperate file. For now, i have built a multideminsional array of strings w/ the values from excel. I am having some difficulties in developing the algorithm to sort them only on the first column. would appreciate it if someone could please provide some pointers or post some code. Thxs
×
×
  • Create New...