Discussion:
UserForm Image Control error
(too old to reply)
DMc2007
2008-10-01 13:18:13 UTC
Permalink
Hi

I am currently having problems with the image control in VBA forms when
trying to programmatically call a image at runtime.

Does naybody have any idea why this occurs.

Run-time error '-2147467259 (80004005)':

Automation error
Unspecified error

If DoesFileExist(strBidPhotos & Me.cboName.Text & ".jpg") = True Then
Me.imgPhoto.Picture = Nothing
Me.imgPhoto.PictureSizeMode = fmPictureSizeModeStretch
Me.imgPhoto.Picture = LoadPicture(strBidWizardPhotos &
Me.cboName.Text & ".jpg") 'Error Line
Else
End If

Regards

D
Andy Pope
2008-10-01 14:41:45 UTC
Permalink
Hi,

Should the image filename be the same as the one being check for existence?
If so,

If DoesFileExist(strBidWizardPhotos & Me.cboName.Text & ".jpg") = True Then

Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Post by DMc2007
Hi
I am currently having problems with the image control in VBA forms when
trying to programmatically call a image at runtime.
Does naybody have any idea why this occurs.
Automation error
Unspecified error
If DoesFileExist(strBidPhotos & Me.cboName.Text & ".jpg") = True Then
Me.imgPhoto.Picture = Nothing
Me.imgPhoto.PictureSizeMode = fmPictureSizeModeStretch
Me.imgPhoto.Picture = LoadPicture(strBidWizardPhotos &
Me.cboName.Text & ".jpg") 'Error Line
Else
End If
Regards
D
DMc2007
2008-10-01 15:35:09 UTC
Permalink
That part is correct, just a typing error on my part in the news group.
Post by Andy Pope
Hi,
Should the image filename be the same as the one being check for existence?
If so,
If DoesFileExist(strBidWizardPhotos & Me.cboName.Text & ".jpg") = True Then
Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Post by DMc2007
Hi
I am currently having problems with the image control in VBA forms when
trying to programmatically call a image at runtime.
Does naybody have any idea why this occurs.
Automation error
Unspecified error
If DoesFileExist(strBidPhotos & Me.cboName.Text & ".jpg") = True Then
Me.imgPhoto.Picture = Nothing
Me.imgPhoto.PictureSizeMode = fmPictureSizeModeStretch
Me.imgPhoto.Picture = LoadPicture(strBidWizardPhotos &
Me.cboName.Text & ".jpg") 'Error Line
Else
End If
Regards
D
Loading...