Please Help Need VB code

Microsoft Excel 2007
October 29, 2009 at 22:19:01
Specs: Windows XP, 2GB
Helo Guys,

I have an excel file. The data is saved in this file from RSlinx. I need a VB code to save this file datewise on daily basis at 5 pm in JPG format

See More: Please Help Need VB code

Report •

October 30, 2009 at 00:02:14
vb script, or vis. basic? maybe this is obvious to most people, but i'm new so pls forgive. 5pm means set up scheduled task to run daily, to me. if visbasic, something like:
shell ("START "+fname+".XLS")
appactivate ... (you'll have to see what window title is)
'alt f: file
sendkeys "%{F}",true
'a: saveAs
sendkeys "a",true
then sendkeys tabs or whatever to get to SAVE AS
box, change to JPG, and sendkeys "{ENTER}",true

best i can do without more information. i have no clue
about RSlinx or jpg-in-excel, so i am benighted as to
these arcana.

Report •

October 30, 2009 at 02:27:24
I have made a VB macro but some it works some time it does not works. some time macro run some time does not run some time data is saved in file some time there is no data saved.
Please help if any one can make it correct

Sub Auto_Open()
Dim myday As String
myday = Weekday(Date)
If myday = 7 Then
Application.OnTime TimeValue("17:33:10"), "Backup"
End If
If myday >= 2 And myday <= 6 Then
Application.OnTime TimeValue("16:33:10"), "Backup"
End If
If myday = 1 Then
Exit Sub
End If
End Sub

Sub Backup()
ActiveWorkbook.SaveLinkValues = True
Dim ObjExcelApp As Object
Dim Fname As String
Set ObjExcelApp = CreateObject("Excel.Application")
ObjExcelApp.Visible = False 'make run in background
ObjExcelApp.Workbooks.Open "C:\STOPPAGES LINE2.xls"
ObjExcelApp.ActiveWorkbook.SaveAs "C:\Break Down Line2\stoppages line2" & Format(Date, "yy-mmm-dd") & ".xls"
ObjExcelApp.ActiveWorkbook.SaveAs "C:\ULFAT\stoppages line2" & Format(Date, "yy-mmm-dd") & ".xls"
For Each w In Application.Workbooks
Next w

End Sub.

Report •

Related Solutions

Ask Question