Click here to Skip to main content
16,009,598 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: HELP!!!!!!!- How to decompile .DLL file to get source code back???? Pin
rwestgraham9-Nov-05 18:27
rwestgraham9-Nov-05 18:27 
QuestionOpening a file to show number of sentences Pin
los_coronado9-Nov-05 12:11
los_coronado9-Nov-05 12:11 
AnswerRe: Opening a file to show number of sentences Pin
Steve Pullan9-Nov-05 12:27
Steve Pullan9-Nov-05 12:27 
GeneralRe: Opening a file to show number of sentences Pin
los_coronado9-Nov-05 14:16
los_coronado9-Nov-05 14:16 
GeneralRe: Opening a file to show number of sentences Pin
Steve Pullan9-Nov-05 14:35
Steve Pullan9-Nov-05 14:35 
GeneralRe: Opening a file to show number of sentences Pin
los_coronado9-Nov-05 15:15
los_coronado9-Nov-05 15:15 
AnswerRe: Opening a file to show number of sentences Pin
Christian Graus9-Nov-05 12:53
protectorChristian Graus9-Nov-05 12:53 
Questionadding data to different rows in excel Pin
DCgamer9-Nov-05 9:23
DCgamer9-Nov-05 9:23 
Hello Forum Members,

I'm a newbie and I'm working on a small windows application that does an "activity" calculation. I would like to send the result of the calculation along with other information gathered (from text boxes) on the application to an excel file, with the ability to re-send new calculations done to the same excel file in the subsequent rows below (with the ability to add as many as I want). I have it working now where I have the headers, and the corresponding values below them going into an excel file. I'm trying to find information on how to get a new calculation into a new row below but I'm stumped. I took me forever to realize that I had to add an excel reference to my project to get the extraction to work. Not even sure if I'm going about this the right way. Any help would be greatly appreciated!!!

Here is the code for my "ExtractData" subroutine.

Private Sub ExtractData2()<br />
       <br />
        'Initialize Excel and create a new workbook/worksheet<br />
        Dim excelApp As New Excel.Application<br />
        Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add<br />
        Dim excelWorksheet As Excel.Worksheet = _<br />
            CType(excelBook.Worksheets(1), Excel.Worksheet)<br />
        'Makes Excel invisible to the user until spreadsheet is populated<br />
        excelApp.Visible = False<br />
<br />
        With excelWorksheet<br />
            excelApp.Visible = True<br />
               <br />
<br />
         .Range("A1").Value = lblDate.Text    ' these are labels that I am using from the designer view<br />
         .Range("A1").Font.Bold = True<br />
         .Range("A1").ColumnWidth = 10<br />
         .Range("B1").Value = lblIDnumber2.Text<br />
         .Range("B1").Font.Bold = True<br />
         .Range("B1").ColumnWidth = 12<br />
         .Range("C1").Value = lblFname2.Text<br />
         .Range("C1").Font.Bold = True<br />
         .Range("D1").Value = lblLname2.Text<br />
         .Range("D1").Font.Bold = True<br />
         .Range("D1").ColumnWidth = 15<br />
         .Range("E1").Value = lblHeight2.Text<br />
         .Range("E1").Font.Bold = True<br />
         .Range("E1").ColumnWidth = 15<br />
         .Range("F1").Value = lblWeight2.Text<br />
         .Range("F1").Font.Bold = True<br />
         .Range("F1").ColumnWidth = 15<br />
         .Range("G1").Value = lblCounts2.Text<br />
         .Range("G1").Font.Bold = True<br />
         .Range("G1").ColumnWidth = 15<br />
         .Range("H1").Value = lblCounttime2.Text<br />
         .Range("H1").Font.Bold = True<br />
         .Range("H1").ColumnWidth = 15<br />
         .Range("I1").Value = lblIsotope2.Text<br />
         .Range("I1").Font.Bold = True<br />
         .Range("I1").ColumnWidth = 15<br />
         .Range("J1").Value = lblEnergy2.Text<br />
         .Range("J1").Font.Bold = True<br />
         .Range("J1").ColumnWidth = 15<br />
         .Range("K1").Value = lblRatio2.Text<br />
         .Range("K1").Font.Bold = True<br />
         .Range("K1").ColumnWidth = 15<br />
         .Range("L1").Value = lblEfficiency2.Text<br />
         .Range("L1").Font.Bold = True<br />
         .Range("L1").ColumnWidth = 15<br />
         .Range("M1").Value = lblActivity2.Text<br />
         .Range("M1").Font.Bold = True<br />
         .Range("M1").ColumnWidth = 15<br />
<br />
         .Range("A2").Value = txtDate2.Text        ' these are text boxes where the user enters values to do the calculation<br />
         .Range("A2").Font.Bold = True<br />
         .Range("A2").ColumnWidth = 10<br />
         .Range("B2").Value = txtIDnumber2.Text<br />
         .Range("B2").Font.Bold = True<br />
         .Range("B2").ColumnWidth = 12<br />
         .Range("C2").Value = txtFname2.Text<br />
         .Range("C2").Font.Bold = True<br />
         .Range("D2").Value = txtLname2.Text<br />
         .Range("D2").Font.Bold = True<br />
         .Range("D2").ColumnWidth = 15<br />
         .Range("E2").Value = txtHeight2.Text<br />
         .Range("E2").Font.Bold = True<br />
         .Range("E2").ColumnWidth = 15<br />
         .Range("F2").Value = txtWeight2.Text<br />
         .Range("F2").Font.Bold = True<br />
         .Range("F2").ColumnWidth = 15<br />
         .Range("G2").Value = txtCounts2.Text<br />
         .Range("G2").Font.Bold = True<br />
         .Range("G2").ColumnWidth = 15<br />
         .Range("H2").Value = txtCounttime2.Text<br />
         .Range("H2").Font.Bold = True<br />
         .Range("H2").ColumnWidth = 15<br />
         .Range("I2").Value = txtIsotope2.Text<br />
         .Range("I2").Font.Bold = True<br />
         .Range("I2").ColumnWidth = 15<br />
         .Range("J2").Value = txtEnergy2.Text<br />
         .Range("J2").Font.Bold = True<br />
         .Range("J2").ColumnWidth = 15<br />
         .Range("K2").Value = txtRatio2.Text<br />
         .Range("K2").Font.Bold = True<br />
         .Range("K2").ColumnWidth = 15<br />
         .Range("L2").Value = txtEfficiency2.Text<br />
         .Range("L2").Font.Bold = True<br />
         .Range("L2").ColumnWidth = 15<br />
         .Range("M2").Value = txtActivity2.Text<br />
         .Range("M2").Font.Bold = True<br />
         .Range("M2").ColumnWidth = 15<br />
        <br />
<br />
         End With<br />
<br />
    End Sub<br />
<br />
Private Sub btnSaveRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveRecord.Click<br />
        ExtractData2()<br />
<br />
<br />
    End Sub<br />


Laugh | :laugh:

DCgamer
AnswerRe: adding data to different rows in excel Pin
rudy.net9-Nov-05 17:49
rudy.net9-Nov-05 17:49 
QuestionEvents not firing in AXWebBrowser Control Pin
Zegoat9-Nov-05 4:23
Zegoat9-Nov-05 4:23 
Questionabout control screensaver Pin
maxiachun8-Nov-05 13:20
maxiachun8-Nov-05 13:20 
AnswerRe: about control screensaver Pin
Christian Graus8-Nov-05 13:54
protectorChristian Graus8-Nov-05 13:54 
QuestionHow can I set a web radio value Pin
Ocean Man8-Nov-05 11:07
Ocean Man8-Nov-05 11:07 
AnswerRe: How can I set a web radio value Pin
Steve Pullan8-Nov-05 11:30
Steve Pullan8-Nov-05 11:30 
GeneralRe: How can I set a web radio value Pin
Ocean Man8-Nov-05 11:48
Ocean Man8-Nov-05 11:48 
AnswerRe: How can I set a web radio value Pin
Allah On Acid8-Nov-05 16:20
Allah On Acid8-Nov-05 16:20 
AnswerRe: How can I set a web radio value Pin
Steve Pullan8-Nov-05 18:10
Steve Pullan8-Nov-05 18:10 
GeneralRe: How can I set a web radio value Pin
Ocean Man9-Nov-05 5:52
Ocean Man9-Nov-05 5:52 
GeneralRe: How can I set a web radio value Pin
Ocean Man9-Nov-05 6:07
Ocean Man9-Nov-05 6:07 
GeneralRe: How can I set a web radio value Pin
Steve Pullan9-Nov-05 11:55
Steve Pullan9-Nov-05 11:55 
QuestionImport Data From Oracle *.DMP File to SQL Server Pin
Nadeem Akhter7-Nov-05 16:02
Nadeem Akhter7-Nov-05 16:02 
QuestionPrinter status is Unknown Pin
VanitaJ7-Nov-05 12:55
VanitaJ7-Nov-05 12:55 
AnswerRe: Printer status is Unknown Pin
VanitaJ8-Nov-05 5:55
VanitaJ8-Nov-05 5:55 
GeneralRe: Printer status is Unknown Pin
Dave Kreskowiak8-Nov-05 10:04
mveDave Kreskowiak8-Nov-05 10:04 
GeneralRe: Printer status is Unknown Pin
VanitaJ8-Nov-05 12:48
VanitaJ8-Nov-05 12:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.