I'm embedding a PDF in an Excel file and then using VBA to open it as follows: Dim objMan As OLEObject Set objMan = ThisWorkbook.Worksheets('Public').OLEObjects.Item('Doc') objMan.Activate The problem I have is that it opens it in the background and the used then needs to manually open it from the taskbar to view it. While looking for some method for an OLEObject to set focus or something, I came across the Verb Method for OLEObjects. States that this method sends a command to the OLEObject and the available commands 'are determined by the object's source application'. My question is: how do I determine what verbs are available for an Adobe Acrobat Document?
Register to get rid of these 'In Post' ads! ------ You can only activate or select a range on the activesheet. So I'm guessing that table isn't the activesheet in ThisWorkbook--or thisworkbook isn't the activeworkbook. I'd use: with thisworkbook.activate with.sheets('table').select 'activate??? With.cells(27 + n - 1, 2).activate end with end with end with But there aren't many things in excel/VBA that require you to select or activate a range/worksheet/workbook/object. Alan wrote: > > I get an error when the code below is executed.
> > With ThisWorkbook.Sheets('table').Cells(27 + n - 1, 2) >.Activate > End With > > The first line evaluates to: > > ThisWorkbook.Sheets('table').Cells(27,2) > > --- Cell B27, which is a merger of Cells B27:M27 --- in this case. > > I get the following error: 1004: Activate method of Range class > failed. > > Any idea why I am getting this error? Thanks, Alan -- Dave Peterson.
My problems began when i 'shared' the worksheet, everything works well except when i tried to navigate using the enter, tab or arrows for which i coded. In that cases i receive the 'run time error 1004' Activate method of OLEObject class failed. Could not see where the trouble araises because the. OLEObject available verbs for Adobe Acrobat Documents. For some method for an OLEObject to set focus. To use the.Activate method on the OLEObject.