ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Debug.Print in a WITH procedure? (https://www.excelbanter.com/excel-programming/319063-debug-print-procedure.html)

Toby Erkson[_3_]

Debug.Print in a WITH procedure?
 
I am creating a subroutine to dump pivot table info into the Immediate window
using Debug.Print. I would like to use the WITH procedure...how do I do it?
I'm not too familiar with the intricacies of the WITH syntax.

This is what I'm looking for:
If ShowMeAll Then
Debug.Print
With WSheet.PivotTables(iIndex).PivotCache
"BackgroundQuery=" & .BackgroundQuery & "; "
"EnableRefresh= " & .EnableRefresh
End With
End If

Thus the output I would see would be:
BackgroundQuery= False; EnableRefresh = True

My output will actually be bigger as I'll be pulling more PivotCache info but
if I can just get the beginning started...
Thanks!
--
Toby Erkson
Oregon, USA
Excel 2003 in Windows XP



Chip Pearson

Debug.Print in a WITH procedure?
 
You need a Debug.Print statement on every line that is to be
printed to the Immediate window.

With WSheet.PivotTables(iIndex).PivotCache
Debug.Print "BackgroundQuery=" &
..BackgroundQuery & "; "
Debug.Print "EnableRefresh= " & .EnableRefresh
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Toby Erkson" wrote in message
...
I am creating a subroutine to dump pivot table info into the
Immediate window
using Debug.Print. I would like to use the WITH
procedure...how do I do it?
I'm not too familiar with the intricacies of the WITH syntax.

This is what I'm looking for:
If ShowMeAll Then
Debug.Print
With WSheet.PivotTables(iIndex).PivotCache
"BackgroundQuery=" & .BackgroundQuery & "; "
"EnableRefresh= " & .EnableRefresh
End With
End If

Thus the output I would see would be:
BackgroundQuery= False; EnableRefresh = True

My output will actually be bigger as I'll be pulling more
PivotCache info but
if I can just get the beginning started...
Thanks!
--
Toby Erkson
Oregon, USA
Excel 2003 in Windows XP





Bryan Dickerson

Debug.Print in a WITH procedure?
 
It should be:

If ShowMeAll Then
With WSheet.PivotTables(iIndex).PivotCache
Debug.Print "BackgroundQuery=" & .BackgroundQuery & "; "
Debug.Print "EnableRefresh= " & .EnableRefresh
End With
End If


"Toby Erkson" wrote in message
...
I am creating a subroutine to dump pivot table info into the Immediate

window
using Debug.Print. I would like to use the WITH procedure...how do I do

it?
I'm not too familiar with the intricacies of the WITH syntax.

This is what I'm looking for:
If ShowMeAll Then
Debug.Print
With WSheet.PivotTables(iIndex).PivotCache
"BackgroundQuery=" & .BackgroundQuery & "; "
"EnableRefresh= " & .EnableRefresh
End With
End If

Thus the output I would see would be:
BackgroundQuery= False; EnableRefresh = True

My output will actually be bigger as I'll be pulling more PivotCache info

but
if I can just get the beginning started...
Thanks!
--
Toby Erkson
Oregon, USA
Excel 2003 in Windows XP





Toby Erkson[_3_]

Debug.Print in a WITH procedure?
 
Rats, that's what I was thinking I'd have to do. No problem though, thx!

"Chip Pearson" wrote in message
...
You need a Debug.Print statement on every line that is to be
printed to the Immediate window.

With WSheet.PivotTables(iIndex).PivotCache
Debug.Print "BackgroundQuery=" &
.BackgroundQuery & "; "
Debug.Print "EnableRefresh= " & .EnableRefresh
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




Toby Erkson[_3_]

Debug.Print in a WITH procedure?
 
More to what I wanted (before gobs of errors cropped up with the additional
items I inserted):

If ShowMeAll Then
With WSheet.PivotTables(iIndex).PivotCache
Debug.Print "BackgroundQuery=" & .BackgroundQuery & "; " _
& "EnableRefresh= " & .EnableRefresh
End With
End If

Thanks for the help! I'm well on my way :-)
Toby


"Bryan Dickerson" wrote in message
...
It should be:

If ShowMeAll Then
With WSheet.PivotTables(iIndex).PivotCache
Debug.Print "BackgroundQuery=" & .BackgroundQuery & "; "
Debug.Print "EnableRefresh= " & .EnableRefresh
End With
End If





All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com