| M. Hussaini 2006-12-12, 1:17 pm |
| I have the following code which I am using in BusinessObjects. The code is
contained in a procedure that saves the BusinessObjects file as an Excel File.
What I want to do is format the Excel file before saving it. Does anybody
have an idea as to how I can programatically open and modify the
ActiveDocument in VBA and format it tru VBA?
Thanks
M. Hussaini
On Error GoTo Emsg
Dim doc As Document
Dim body As String
Dim ReportName As String
Dim locPath As String
Dim objExcel As Object
Dim myObjExcel As Excel.Worksheet
Dim myObjWorkBook As Excel.Workbooks
dDate = Format((Now() - 27), "mmmm dd, YYYY")
Set doc = ActiveDocument
doc.Refresh
locPath = " \\Fpptc01vgc02\O_drive\Sales\DomSales\Pr
ivate\Sales Reporting\"
ReportName = ActiveDocument.Name & ".xls"
'-----------------------------------------------------
'Deleteing old report
'------------------------------------------------------------
'Kill locPath & "\" & ReportName & ".xls"
'-----------------------------------------------------
'Saving report
'------------------------------------------------------------
doc.SaveAs (locPath & "\" & ReportName & ".xls")
|