G
Guest
In Access I'm opening up an Excel Spreadsheet and copying a range of cells
then pasting that information into a Word Document which then gets printed
out.
When the spreadsheet is closing, I get the following message which I would
like to suppress so that the user does not have to answer the Yes, No or
Cancel prompt.
"There is a large amount of information on the Clipboard. Do you want to be
able to paste this information into another program later?
To save it on the Clipboard so you can paste it later, click yes.
To delete it from the Clipboard and free memory, click no."
Here is part of the code I am using to perform the function. I believe the
message is being generated after the "objWkb.Application.ActiveWindow.Close
SaveChanges:=False" command.
I tried using the DoCmd.SetWarnings False command but that did not suppress
the message. What can I do and how would I do it to suppress the message?
Thanks.
Set objXL = New Excel.Application
strSpread = DLookup("[DataPath]", "tblApplicationInfo") &
"CutSheets\" & CRS3.Fields("FileName")
With objXL
.Visible = False 'True
Set objWkb = .Workbooks.Open(strSpread)
'CRS3.Fields("FileName"))
Dim objRange As Excel.Range
Set objRange = .Range(CRS3.Fields("PrintRange"))
objRange.Select
objRange.Copy
Set objRange = Nothing
End With
End If
'Copy the selection into the Word document
Forms!fmOrders.Caption = "Copying Cut Sheet info into Word document"
objWord.Selection.GoTo What:=wdGoToBookmark, Name:="Chart"
strLocation = "Paste Excel Cells into Word"
With objWord
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, _
Placement:=wdInLine, DisplayAsIcon:=False
End With
'End If
'Close the Cut Sheet
strLocation = "Quit Excel"
Forms!fmOrders.Caption = "Closing Excel"
objWkb.Application.ActiveWindow.Close SaveChanges:=False
then pasting that information into a Word Document which then gets printed
out.
When the spreadsheet is closing, I get the following message which I would
like to suppress so that the user does not have to answer the Yes, No or
Cancel prompt.
"There is a large amount of information on the Clipboard. Do you want to be
able to paste this information into another program later?
To save it on the Clipboard so you can paste it later, click yes.
To delete it from the Clipboard and free memory, click no."
Here is part of the code I am using to perform the function. I believe the
message is being generated after the "objWkb.Application.ActiveWindow.Close
SaveChanges:=False" command.
I tried using the DoCmd.SetWarnings False command but that did not suppress
the message. What can I do and how would I do it to suppress the message?
Thanks.
Set objXL = New Excel.Application
strSpread = DLookup("[DataPath]", "tblApplicationInfo") &
"CutSheets\" & CRS3.Fields("FileName")
With objXL
.Visible = False 'True
Set objWkb = .Workbooks.Open(strSpread)
'CRS3.Fields("FileName"))
Dim objRange As Excel.Range
Set objRange = .Range(CRS3.Fields("PrintRange"))
objRange.Select
objRange.Copy
Set objRange = Nothing
End With
End If
'Copy the selection into the Word document
Forms!fmOrders.Caption = "Copying Cut Sheet info into Word document"
objWord.Selection.GoTo What:=wdGoToBookmark, Name:="Chart"
strLocation = "Paste Excel Cells into Word"
With objWord
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, _
Placement:=wdInLine, DisplayAsIcon:=False
End With
'End If
'Close the Cut Sheet
strLocation = "Quit Excel"
Forms!fmOrders.Caption = "Closing Excel"
objWkb.Application.ActiveWindow.Close SaveChanges:=False