locked
GoTo from Excel to Windows RRS feed

  • Question

  • Hello,

    <g class="gr_ gr_24 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="24" id="24">i</g> am using a spreadsheet to capture test <g class="gr_ gr_71 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" data-gr-id="71" id="71">cases,</g> and in the process of automating the generation of a word document for presentation to the business. I can't get the GoTo function to work across the files, however.

    <g class="gr_ gr_312 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="312" id="312">Here's</g> the two pertinent subs:

    Sub CreateTestDocument()

    Set wordapp = CreateObject("word.Application")

    Set Wordfile = wordapp.Documents.Open("S:\IT Dev - Test\Testing Templates\TestPlanTemplate.dotm")

    wordapp.Visible = True

    AddNextCase ("FeatureCases")

    'PullProperties'

    'UpdateProperties

    End Sub

    Sub AddNextCase(Bmark As String)
    
    Wordfile.Activate
    
    Wordfile.SelectAllEditableRanges
    
    ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:=Bmark 'ERROR HERE
    
    Selection.TypeText "TEST1"
    
    
    End Sub

    on the selection<g class="gr_ gr_391 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="391" id="391">.goto</g> line, <g class="gr_ gr_389 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="389" id="389">i</g> am returned the error below:

    Run-time error '438:

    Object doesn't support this property or method

    I've tried various different approaches to this, but <g class="gr_ gr_602 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="602" id="602">i</g> always hit a blocker on setting my entry point to start putting this text block in


    Monday, July 9, 2018 11:25 AM