|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Excel Page Break Preview
Hi,
I am opening an Excel sheet from a HTML page using VB Scripts. I also need to view the Excel sheet in page break preview mode. The code is as follows, Without the setting of the constant("xlPageBreakPreview") , the code does work fine. Can anyone help me in solving this. Sub Download2Excel Set xlApp = CreateObject("Excel.Application") xlApp.Visible = True xlApp.Workbooks.Add xlApp.ActiveWindow.View = xlPageBreakPreview xlApp.Range("A1").Select xlApp.ActiveCell.FormulaR1C1 = "NEW STORES" xlApp.Selection.Font.Bold = True xlApp.Range("A2").Select xlApp.ActiveCell.FormulaR1C1 = "Stock Ledger Report" xlApp.Selection.Font.Bold = True xlApp.Range("A3").Select xlApp.ActiveCell.FormulaR1C1 = "For February FY 2003: Week 05" xlApp.Selection.Font.Bold = True R = 0 xlApp.Range("A6").Select strFileName = "RP200305.xml" Set oDoc = CreateObject("MSXML.DOMDocument") oDoc.async = False oDoc.validateOnParse = True oDoc.Load strFileName If oDoc.parseError.errorCode = 0 Then For Each ANode In oDoc.childNodes If ANode.hasChildNodes Then For Each oNode In ANode.childNodes If oNode.hasChildNodes Then For Each cNode In oNode.childNodes C = 0 For Each c1Node In cNode.childNodes xlApp.ActiveCell.Offset(R, C).ColumnWidth = 13 xlApp.ActiveCell.Offset(R, C).Value = c1Node.NodeTypedValue C = C + 1 Next R = R + 1 Next R = R + 1 End if Next End if Next End If End Sub |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Excel Page Break Preview |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|