ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   unable to set the OnAction Property of the Text Box (https://www.excelbanter.com/excel-programming/284860-unable-set-onaction-property-text-box.html)

Russell Harris

unable to set the OnAction Property of the Text Box
 
I have a spreadsheet sent out to different countries around the world. When
it needs amendment a fix me file is sent out.



The following code works on all spreadsheets but those that have been in the
USA ?



It fails at the ** line with "unable to set the OnAction Property of the
Text Box Class"



Any suggestions would be appreciated.



Sub add_printbutton()

sMMAFILE = ActiveWorkbook.Name



Windows(sMMAFILE).Activate

Sheets("Title").Select



ActiveSheet.Shapes("Text Box 80").Select

Selection.Copy

Range("J33").Select

ActiveSheet.Paste

Selection.OnAction = sMMAFILE & "!pr_YE" ******************





Bill Manville

unable to set the OnAction Property of the Text Box
 
Russell Harris wrote:
The following code works on all spreadsheets but those that have been in the
USA ?

It fails at the ** line with "unable to set the OnAction Property of the
Text Box Class"

Selection.OnAction = sMMAFILE & "!pr_YE" ******************


If sMMAFILE might have a space in it then you need

Selection.OnAction = "'" & sMMAFILE & "'!pr_YE"


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com