what i am doing wrong (In rs view32-excel report)

Join Date
Apr 2006
Location
pune
Posts
18
hi
i am working on rs view32 in which i want to do report in excel.i write the script as follows but it doesnt work.
there is a error "file is not found".i think that excel file is not genrating.
Sub createexclefile()
Dim objExcel As Object
Dim sha As String
Dim sk As Tag
Set objExcel = CreateObject("Excel.Application")
sha = gProject.Path & "\VBA\ssk.xls"
objExcel.Workbooks.Open (sha)
objExcel.Application.Visible = True
objExcel.Application.windostate = -4137
objExcel.Application.activwindow.windostate = -4137
sHeight = objExcel.Height
objExcel.worksheets("sourcedata").activate
objExcel.Column(1).columnwidth = 13.5
objExcel.Column(2).columnwidth = 19
sk.Value = 15
If sHeight < 350 Then
objExcel.activewindow.Zoom = 50
Else
If sHeight < 440 Then
objExcel.activewindow.Zoom = 75
End If
End If
For nColumn = 1 To 7
objExcel.Column(nColumn).horizantalalignment = -4108
Next nColumn
With objExcel
.Rows(1).Font.Bold = True
.cells(1, 1).Value = "time and date"
.cells(1, 2).Value = "recipe name"
.cells(1, 3).Value = "coffee"
.cells(1, 4).Value = "sugar"
.cells(1, 5).Value = "cream"
.cells(1, 6).Value = "cocoa"
.cells(1, 7).Value = "irish"
.cells(1, 8).Value = sk.Value
End With
End Sub
 
dear sir
thank you for your valuable replay.But sha = gProject.Path & "\VBA\ssk.xls" in this statment i am allready given the path which is project path
i also tried whit your suggestion but it is also not working

thanks
shailesh
 

Similar Topics

I am latching and unlatching "result_Data_latch" bit within same rung. Will This copy/move instruction execute correctly??
Replies
4
Views
193
In Easy Builder Pro: Unexpected results... I've got a toggle switch set to trigger a macro to write a specified integer or a 0 depending on the...
Replies
7
Views
2,314
I created default values for some new alarm setpoints. They are D361,D327,D329,D331 (see pic). When I put them into monitor mode, I was expecting...
Replies
23
Views
5,228
I'm trying to configure an ethernet driver and when I browse sswho nothing shows up on the network. I have very little experience with...
Replies
9
Views
4,896
i have a plc ab 1400 with a module 1762-iq8 but rslinx cannt detect this module, only the plc. :confused: there is a different way to detect the...
Replies
2
Views
1,361
Back
Top Bottom