Greetings all,
I am currently learning visual basic .net on the fly for a project at work and I am having some issues. I have learned most of what (little) I know from posts on these forums, but I cant seem to find any help for my particular problem.
I have arrays of doubles from reading data files, and all i want to do is export the arrays to excel. I am currently looping through each cell, but it is taking quite a long time with sizes of the arrays.
I have attempted the method outlined by microsoft (How to transfer data to an Excel workbook by using Visual Basic .NET) but I cant get it to work. From what I can tell, the command to export the array is :
'Transfer the array to the worksheet starting at cell A2.
oSheet.Range("A2").Resize(100, 3).Value = DataArray
but i am doing something wrong because it isnt working.
One thought I have is that the data array on that page is defined as an object, and I define mine as an array of doubles. I tried to dimension the array to an object, but got the same results.
I have exhausted my google skills searching for help, but have only come across variations on the microsoft method above and large programs that I cant understand.
any thoughts anyone may have with what I am doing wrong would be greatly appreciated. below is the chunk of code I tried without success.
Thanks!
Dim dblPhiPelvis() As Object 'I get the values in this array from external file
'I know the array is built properly because i can export into excel with a basic for loop
''start a new excel sheet called Pelvis
objSheets = objBook.Worksheets
objSheet = objSheets(2)
objSheet.Name = "Pelvis" 'one chart for all ATD's?
'populate spreadsheet with Time, Force(Phi), Force above threshold,
objSheet.Range("D4").Resize(100, 1).Value = dblPhiPelvis
I am currently learning visual basic .net on the fly for a project at work and I am having some issues. I have learned most of what (little) I know from posts on these forums, but I cant seem to find any help for my particular problem.
I have arrays of doubles from reading data files, and all i want to do is export the arrays to excel. I am currently looping through each cell, but it is taking quite a long time with sizes of the arrays.
I have attempted the method outlined by microsoft (How to transfer data to an Excel workbook by using Visual Basic .NET) but I cant get it to work. From what I can tell, the command to export the array is :
'Transfer the array to the worksheet starting at cell A2.
oSheet.Range("A2").Resize(100, 3).Value = DataArray
but i am doing something wrong because it isnt working.
One thought I have is that the data array on that page is defined as an object, and I define mine as an array of doubles. I tried to dimension the array to an object, but got the same results.
I have exhausted my google skills searching for help, but have only come across variations on the microsoft method above and large programs that I cant understand.
any thoughts anyone may have with what I am doing wrong would be greatly appreciated. below is the chunk of code I tried without success.
Thanks!
Dim dblPhiPelvis() As Object 'I get the values in this array from external file
'I know the array is built properly because i can export into excel with a basic for loop
''start a new excel sheet called Pelvis
objSheets = objBook.Worksheets
objSheet = objSheets(2)
objSheet.Name = "Pelvis" 'one chart for all ATD's?
'populate spreadsheet with Time, Force(Phi), Force above threshold,
objSheet.Range("D4").Resize(100, 1).Value = dblPhiPelvis