Results 1 to 2 of 2

Thread: Launching Word from VB Net, File not found error

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2014

    Launching Word from VB Net, File not found error

    Hey everyone,

    So I've had this error in the past and had some wonderful help from these forums so I'll try once more to see if I can figure out a permanent solution to this new problem I'm experiencing. Below is the code I'm using to launch Word and attach a template to the document. The template it's attaching is located from the amazonaws.com service (txtRes2.Text).
                    oWord = DirectCast(CreateObject("Word.Application"), Word.Application)
                    oWord.Visible = True
                    oDoc = oWord.Documents.Add(txtRes2.Text)
                Catch ex As Exception
                    Exit Sub
                End Try
    I have about 200+ people using this software and I've had 20+ people encounter the error "Sorry, we couldn't find your file. Was it moved, renamed, or deleted". Typically what I would do with anyone who had this error pop up was go into their control panel, remove any version of Microsoft Office on their computer that they weren't using. This was always the case that someone had either two versions of Office on their computer or had upgraded/downgraded from a previous version. I would then proceed to click on the current Office version they were using and do a quick repair. This would resolve the problem without a hitch.

    But now there's about 3-4 individuals that have also experienced this problem where this solution did not correct it. So my current work around for them is that when they click on the link to launch word and attach a template, is it will download the template to their computer first and then launch Word and attach the template from the location on their harddrive rather than trying to attach the template from the amazonaws.com website. So the issue is pretty narrowed down, but I'm just out of ideas at this point. Also within Word I have changed the setting on their computer in the Trust Settings to disable protected view for files originating from the internet.

    Any insight would be greatly appreciated. If you require any more code or have any questions please ask. I really don't want to have to create workarounds if I don't have to.
    Last edited by Shaggy Hiker; Feb 1st, 2018 at 10:20 AM. Reason: Added CODE tags

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002

    Re: Launching Word from VB Net, File not found error

    Welcome (back) to the forum. I edited your post to add [CODE][/CODE] tags, which you can do by highlighting the code and pressing the # button, or pressing the button first and pasting the code between the tags.

    txtRes2.Text looks like a textbox. Is it? And if it is, what does it hold? Is it right? It seems like it must not be, and that's where I'd start based on the code shown. After all, you pretty much know that the rest of the code you showed works, as long as the contents of that string are correct, so the contents of the string must not be correct.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width