I am writing reports from Access to Excel using automation. I want the reports to be saved with no scroll bars and with a zoom setting, plus other settings, using the following code…
With wksReport
.DisplayPageBreaks = False
.Activate
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.Zoom = 88
End With
End With
With appExcel
.DisplayFormulaBar = False
.DisplayStatusBar = False
.DisplayScrollBars = False
End With
The problem is that when I’ve finished running the code I am still left with an Excel Image running in Task Manager. This causes problems when running again without manually deleting the image using “End Process” and/or closing the Access application.
If run without taking this action I get a RPC Server Unavailable error. This error I’ve seen before with Automation and can usually sever all links by setting the object references to nothing, but I don’t know what to do in this instance.
Any help is greatly appreciated and I’ll make sure Santa gives you whatever you want this Christmas
Thanks
With wksReport
.DisplayPageBreaks = False
.Activate
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.Zoom = 88
End With
End With
With appExcel
.DisplayFormulaBar = False
.DisplayStatusBar = False
.DisplayScrollBars = False
End With
The problem is that when I’ve finished running the code I am still left with an Excel Image running in Task Manager. This causes problems when running again without manually deleting the image using “End Process” and/or closing the Access application.
If run without taking this action I get a RPC Server Unavailable error. This error I’ve seen before with Automation and can usually sever all links by setting the object references to nothing, but I don’t know what to do in this instance.
Any help is greatly appreciated and I’ll make sure Santa gives you whatever you want this Christmas
Thanks