Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2010 VBA

Status
Not open for further replies.

integritycare

Technical User
Mar 12, 2011
151
AU
Hi,
I have created an excel workbook with just a few command buttons
On my computer which is win 8 and using Office 2010 I have no issues with the command buttons working.
However when I take a copy of the workbook to the office which is using the same version of office, but on Windows 7 the command buttons are ok.
But when I save a copy on tge office computer take it home and open it up on my computer the command buttons do not work.

On investigation I have found that the command button name in the properties has changed from command button1 to command button6. This has happened on all the spreadsheets in this workbook.
What is the issues. Just can't figure this one out.

The code just on one of the command buttons is this, which initially worked on my computer:
Code:
Private Sub CommandButton1_Click()
Dim dFileSaveAs As Boolean
bFileSaveAs = Application.Dialogs(xlDialogSaveAs).Show
If Not bFileSaveAs Then MsgBox "User Cancelled Saving this Book", vbCritical
End Sub

This is what happens with this problem

Code:
Private Sub CommandButton6_Click()

End Sub


A real pain..
Many Thanks
KP

 
You should be using forum707 for VBA questins.

But, did you try to name your command buttons something like [tt]cmdHello[/tt] or [tt]cmdReturn[/tt] or [tt]cmdCaclulate[/tt] and see if this will change, too?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top