Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Error 2147418113 -Method failed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thronz - 17 Dec 2006 18:23 GMT
I have a Userform that is used to create a printed form. One of the command
buttons runs trhe following code:

Private Sub Photo_Click()
Dim locat As String
'Load Photo onto Userform
locat = "N:\Security\Reception\Contractors" & "\" & TextBox5.Value & ".jpg"
Image1.PictureSizeMode = fmPictureSizeModeZoom
Image1.Picture = LoadPicture(locat)
End Sub

This was running fine. I was then asked if the information entered on the
Userform could be used to update a database. This is done in another Sub
routine (same one as the code to print the form). I had it working, but I
find out now that an error is generated when the "Photo" commandbutton is
activated. The second to last line of code :"Loadpicture" causes the error.

Thanks for your time.
Happy Holidays
Cindy M. - 25 Dec 2006 11:17 GMT
Hi =?Utf-8?B?VGhyb256?=,

Hard to say without seeing all the code and know in which code module it
resides, but my guess would be that something may be going out of scope at
some point.

If you hardcode the path for locat, as a test, do you see any different
behavior?

> I have a Userform that is used to create a printed form. One of the command
> buttons runs trhe following code:
[quoted text clipped - 12 lines]
> find out now that an error is generated when the "Photo" commandbutton is
> activated. The second to last line of code :"Loadpicture" causes the error.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Thronz - 21 Feb 2007 19:17 GMT
It's been a while since I've been able to work on this.
I am still getting the error message.
I have tried this:

    Private Sub Photo_Click()
    Dim Image1 As Object
       Image1.Picture =
LoadPicture("N:\Security\Reception\Contractors\nopix.Jpg")
    End Sub

and I have even tried it with the graphic as a bitmap due to some info I
read about supported file types, but no luck.
The intent of the project is to load the photo onto the userform by clicking
a button, then the operator fills a few fields and clicks another button to
print the form.

Can anybody help?

> Hi =?Utf-8?B?VGhyb256?=,
>
[quoted text clipped - 29 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.