none
Word not visible RRS feed

  • Question

  • This is the code I have attached to  my form button, it used to work fine before I changed to Windows 7 64 bit from Vista 32 bit, ms2010.

    it still works but is not visible!

    Private Sub BriberyAct2010_Click()


    AbbeyControls.Hide


    Application.ScreenUpdating = False


    Set wdApp = CreateObject("Word.Application")
    wdApp.documents.Open "C:\Users\Paul Wrigley\Documents\Abbey Services\Policies and Proceedures\Bribery Act 2010.doc"
    wdApp.Visible = True


    Workbooks("Abbey Services Open Folders.xlsm").Activate
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    End Sub

    Monday, March 10, 2014 11:52 AM

Answers

  • Hi,

    I failed to reproduce the issue on my test environment (Windows 7 + Office 2010).
    Here is the steps:

    1. create a new excel and copy the code below to the sheet module

    Private Sub BriberyAct2010_Click()
    
    '
    ' AbbeyControls.Hide
    
    
    Application.ScreenUpdating = False
    
    
    Set wdApp = CreateObject("Word.Application")
    wdApp.documents.Open "C:\Users\v-fexue\Desktop\New Microsoft Word Document.docx"
    wdApp.Visible = True
    
    
    ' Workbooks("Abbey Services Open Folders.xlsm").Activate
    ' ActiveWorkbook.Save
    ' ActiveWorkbook.Close
    End Sub
    

    2. run the sub

    The Word application shows correctly. I suggest you closing all Word documents and kill all Word Application processes, then create a simple sample like above to see whether the code works.
    Also you can debug to check whether the code below is executed

    wdApp.Visible = True

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 11, 2014 11:35 AM
    Moderator

All replies

  • Hello Abbey,

    Did you try to set the Visible property to true before opening the document?

    Also I'd recommend to remove the following line of code and see whether it helps:

    Application.ScreenUpdating = False
    

    Finally, you can try to use the Application.ScreenRefresh method.
    Monday, March 10, 2014 12:56 PM
  • Hi,

    I failed to reproduce the issue on my test environment (Windows 7 + Office 2010).
    Here is the steps:

    1. create a new excel and copy the code below to the sheet module

    Private Sub BriberyAct2010_Click()
    
    '
    ' AbbeyControls.Hide
    
    
    Application.ScreenUpdating = False
    
    
    Set wdApp = CreateObject("Word.Application")
    wdApp.documents.Open "C:\Users\v-fexue\Desktop\New Microsoft Word Document.docx"
    wdApp.Visible = True
    
    
    ' Workbooks("Abbey Services Open Folders.xlsm").Activate
    ' ActiveWorkbook.Save
    ' ActiveWorkbook.Close
    End Sub
    

    2. run the sub

    The Word application shows correctly. I suggest you closing all Word documents and kill all Word Application processes, then create a simple sample like above to see whether the code works.
    Also you can debug to check whether the code below is executed

    wdApp.Visible = True

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 11, 2014 11:35 AM
    Moderator