is this for storing the data or opening the file in VB?
Nurilhansiz 0 Newbie Poster
hi again.. i have a problem with excel.. tried to print a chart using excel nia vb but it doesnt work and when it does, it keep producing charts tat are infinity..ALOT OF chart without stopping! HELP!!
Private Sub cmdExcel_Click()
'
'
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Dim xlColumn As Axis
'Dim xlLocationAsObject As Axis
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets.Add
With xlApp
.Visible = True
' Macro recorded 11/14/2006 by CrashOverride
.Range("A2").Select
.ActiveSheet.Paste
.Range("B2").Select
.ActiveSheet.Paste
.ActiveWindow.SmallScroll Down:=0
.Range("C2").Select
.ActiveSheet.Paste
.ActiveWindow.SmallScroll Down:=-3
.Range("A3:A9").Select
.ActiveWindow.SmallScroll Down:=-9
.Range("A1:C36").Select
.ActiveWindow.SmallScroll Down:=3
.Range("B35").Select
.ActiveCell.FormulaR1C1 = "12.94"
.Range("A1:C36").Select
.Range("C36").Activate
.Charts.Add
.ActiveChart.ChartType = xlLine
.ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:C36"), PlotBy _
:=xlColumns
.ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Assembly Mistakes"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "No of ribs"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Tolerance"
End With
.ActiveSheet.Shapes("Chart 1").ScaleWidth 1.5, msoFalse, msoScaleFromTopLeft
.ActiveChart.Legend.Select
.Selection.Position = xlBottom
.ActiveChart.Axes(xlValue).Select
.Windows("Book2").SmallScroll Down:=-3
End With
End Sub
Nurilhansiz 0 Newbie Poster
hi!
im somekind in a lost mode.how can i call a txtfile out so that it can run a machine?
eg if i press this cmdA, it will call out txtfile1 and txtfile1(the command to run the machine is stored in here) will run the machine.
and also how is it possible to store in the data collected(by the machine tats running) to textfile?:?: :?: :?: i tried using
Open "\your_name.txt" For Input As #1
Do While Not EOF(1)
intCount = intCount + 1
Print #1, txtWord.Text
Loop
Close #1
but it gives error..what went wrong??im not sure if im doing it correctly.:eek:
im having my final year proj and i hav to learnt this frm scratch as i never done VB in my life..sooo complicating
thnX!