R
Reinfried Englmair
With the VBA-Code:
Sub Sub CopyToXL_1()
Dim sHTML, oXL, oBook
'Replace the mso-pattern style in the HTML returned from
the PivotTable.
sHTML = ptable.HTMLData
sHTML = Replace (sHTML, "mso-pattern:auto;", "mso-
pattern:auto none;")
'Open the HTML file in Excel using Automation.
Set oXL = CreateObject("Excel.Application")
Set oBook = oXL.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Tabelle1").Text =
sHTML
oBook.HTMLProject.Refreshdocument
oXL.Visible = True
oXL.UserControl = True
End SubDim sHTML, oXL, oBook
'Replace the mso-pattern style in the HTML returned from
the PivotTable.
sHTML = ptable.HTMLData
sHTML = Replace (sHTML, "mso-pattern:auto;", "mso-
pattern:auto none;")
'Open the HTML file in Excel using Automation.
Set oXL = CreateObject("Excel.Application")
Set oBook = oXL.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Tabelle1").Text =
sHTML
oBook.HTMLProject.Refreshdocument
oXL.Visible = True
oXL.UserControl = True
End Sub
I copy the pivottable to Excel.
Now i need a function to modify in the code Sub CopyToXL_1
the forecolor for negativ values.
In Excel I make this by:
Dim c As Object
For Each c In ActiveSheet.UsedRange
If c.Value <= 0 Then c.Font.Color = vbRed
Next c
Is there a solution to make the same with HTMLProject????
Thank's to all
Sub Sub CopyToXL_1()
Dim sHTML, oXL, oBook
'Replace the mso-pattern style in the HTML returned from
the PivotTable.
sHTML = ptable.HTMLData
sHTML = Replace (sHTML, "mso-pattern:auto;", "mso-
pattern:auto none;")
'Open the HTML file in Excel using Automation.
Set oXL = CreateObject("Excel.Application")
Set oBook = oXL.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Tabelle1").Text =
sHTML
oBook.HTMLProject.Refreshdocument
oXL.Visible = True
oXL.UserControl = True
End SubDim sHTML, oXL, oBook
'Replace the mso-pattern style in the HTML returned from
the PivotTable.
sHTML = ptable.HTMLData
sHTML = Replace (sHTML, "mso-pattern:auto;", "mso-
pattern:auto none;")
'Open the HTML file in Excel using Automation.
Set oXL = CreateObject("Excel.Application")
Set oBook = oXL.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Tabelle1").Text =
sHTML
oBook.HTMLProject.Refreshdocument
oXL.Visible = True
oXL.UserControl = True
End Sub
I copy the pivottable to Excel.
Now i need a function to modify in the code Sub CopyToXL_1
the forecolor for negativ values.
In Excel I make this by:
Dim c As Object
For Each c In ActiveSheet.UsedRange
If c.Value <= 0 Then c.Font.Color = vbRed
Next c
Is there a solution to make the same with HTMLProject????
Thank's to all