הצטרפו לקבוצות שלנו לקבלת עדכונים מרוכזים פעם בשבוע:

ווטסאפ:
http://wa.dwh.co.il
טלגרם:
http://telegram.dwh.co.il

scheduling to export xls file

More
13 years 9 months ago #7513 by itzik
שלום,
כיצד אני יכול לבצע EXPORT של טבלה ממודל לפורמט XLS ,כאשר היצוא ל XLS יתבצע כל יום לאחר סיום ריצה ( המודל מתוזמן לרוץ פעם ביום )?
תודה .

Please התחברות to join the conversation.

More
13 years 9 months ago #7516 by yigal.beno
היי איציק,

ראשית יש להוסיף את פקודת המאקרו לייצוא לאקסל,
לאחר מכן להגדיר ב:
Settings->Document properties->Trrigers->On Post Reload
את ריצת המקרו.

מצ"ב קובץ לדוגמא.

בהצלחה.

Attachment Excel.qvw not found

Attachments:

Please התחברות to join the conversation.

More
13 years 9 months ago #7517 by itzik
לפני הכל תודה רבה,
זה עובד מעולה.!
אני מעוניין ליצא את הקובץ הנ"ל במייל ,יש לך הצעה כיצד לעשות זאת.
אני חשבתי שאולי ניתן שהקובץ ילך לספריה ספציפית שתוגדר במקרו ואז ניתן לבצע זאת ע"י TASK SCHEDULER .
(כיצצד אני שומר את הקובץ במקרו בספריה ספציפית? ודואג שהשם של הקובץ לא ישתנה וישאר קבוע?)
הרבה תודה על העזרה

Please התחברות to join the conversation.

More
13 years 9 months ago - 13 years 9 months ago #7518 by yigal.beno
היי איציק,

הוספתי כמה שינויים:
sub CopyToXL2
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = FALSE
set XLDoc = XLApp.Workbooks.Add
XLDoc.Sheets(1).name = "Supervisor Report"
set XLSheet = XLDoc.Worksheets(1)
set MyTable = ActiveDocument.GetSheetObject("TB01")
set XLSheet = XLDoc.Worksheets(1)
MyTable.CopyTableToClipboard true
XLSheet.Paste XLSheet.Range("A1")
XLDoc.SaveAs "C:\Users\igal\Documents\BU\MyRep.xlsx"


XLApp.Visible = False
XLApp.Quit
Set XLApp = Nothing
Set Table = Nothing
end sub

sub CopyToXL2

set XLApp = CreateObject("Excel.Application")
XLApp.Visible = FALSE
set XLDoc = XLApp.Workbooks.Add
XLDoc.Sheets(1).name = "Supervisor Report"
set XLSheet = XLDoc.Worksheets(1)
set MyTable = ActiveDocument.GetSheetObject("TB01")
set XLSheet = XLDoc.Worksheets(1)
MyTable.CopyTableToClipboard true
XLSheet.Paste XLSheet.Range("A1")
XLDoc.SaveAs "C:\Users\igal\Documents\BU\MyRep.xlsx"

XLApp.Visible = False
XLApp.Quit
Set XLApp = Nothing
Set Table = Nothing

end sub

Sub SendGMail()

' Object creation
Set objMsg = CreateObject("CDO.Message")
Set msgConf = CreateObject("CDO.Configuration")

' Server Configuration

msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/sendusing ") = 2
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/smtpserver ") = "smtp.gmail.com"
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/smtpserverport ") = 465
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/smtpauthenticate ") = 1
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/sendusername ") = "From@gmail.com"
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/sendpassword ") = "mailPasseord"
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/smtpusessl ") = 1

msgConf.Fields.Update

' Email
objMsg.To = "SendTo@gmail.com"
objMsg.From = "From@gmail.com"
objMsg.Subject = "Subject You Want"
objMsg.HTMLBody = "Body Of The Mail"
objMsg.Sender = "YourName"

' If you have attachment
Path ="C:\Users\igal\Documents\BU\"
FileName="MyRep.xlsx"
objMsg.AddAttachment Path&FileName


Set objMsg.Configuration = msgConf

' Send
objMsg.Send
' Clear
Set objMsg = nothing
Set msgConf = nothing
End Sub

יש לשים לב:
הנתיב בו נרצה לשמור את הקובץ:

XLDoc.SaveAs "C:\Users\igal\Documents\BU\MyRep.xlsx"

אימייל השולח והסיסמא.
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/sendusername ") = "From@gmail.com"
msgConf.Fields.Item(" schemas.microsoft.com/cdo/configuration/sendpassword ") = "mailPasseord"


נתונים עבור השליחה:
' Email
objMsg.To = "SendTo@gmail.com"
objMsg.From = "From@gmail.com"
objMsg.Subject = "Subject You Want"
objMsg.HTMLBody = "Body Of The Mail"
objMsg.Sender = "YourName"

' If you have attachment
Path ="C:\Users\igal\Documents\BU\"
FileName="MyRep.xlsx"
objMsg.AddAttachment Path&FileName

שמח לעזור,

בהצלחה.

Attachment ExportToExcelMail-20120229.qvw not found

Attachments:
Last edit: 13 years 9 months ago by yigal.beno.

Please התחברות to join the conversation.

Moderators: avishaylgiladlDaniel Chotzenodedth
Time to create page: 0.275 seconds