Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 9th, 2004, 03:58 AM
prajeesh prajeesh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Bangalore, India
Posts: 2 prajeesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Excel Page Break Preview


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway