PDA

View Full Version : why can i see it and other can't?



hibiscus27
04-19-2007, 12:27 PM
Hello

I have code attached to a button that opens up a dialog box where they can find a file and attach/embed to excel.

Essentially if they need to attach the file, the check the appropriate box. Then a button appears. This button will allow them to find the file and it attaches the file as an icon.

The problem is that some of us can do it...others can't. Here's what I mean. All of us can check the box and the button appears. But some when they click the button (which opens up the dialog box) they get sent to the VBA code instead.

How can I fix this??? Thanks!!!!


'***** On click the attach file button appears
Private Sub CheckBox1_Click()
If CheckBox1.Value = "True" Then
btnAddFile1.Visible = True
Else
btnAddFile1.Visible = False
End If

End Sub

'***** Inserts or embeds file into form
Private Sub btnAddFile1_Click()
Dim vFile As Variant
vFile = Application.GetOpenFilename("All Files(*.*),*.*", Title:="Find file to insert")
If vFile = False Then GoTo Cancel
ActiveSheet.OLEObjects.Add Filename:=vFile, Link:=False, DisplayAsIcon:=True, IconLabel:="test"

Exit Sub

'If X was equal to false, displays a message and exits the macro
Cancel:
MsgBox "The Cancel button was selected."
End Sub

malik641
04-19-2007, 04:05 PM
Hi hibiscus27 and welcome to VBAX :hi:

A couple of questions:
-When the users get sent to the VBE, is there and error that pops up also?
-Are they using different versions of Excel and/or Windows (not just different years. Prof. vs Home, also)?

hibiscus27
04-20-2007, 06:08 AM
I'm not sure about an error message. I'll talk to some of them later today and find out.

Could the fact that the users having issues are located in Mexico have anything to do with it?:dunno

malik641
04-21-2007, 07:00 PM
I'm not sure about an error message. I'll talk to some of them later today and find out.
Hey, any word on this?


Could the fact that the users having issues are located in Mexico have anything to do with it?:dunno
I'm not sure. I've never delt with any non-US version of Excel (somebody please correct me if MS creates one main version of Excel and simply offer different language packs).

And what year of Excel are we dealing with?