Button Error - Save at location

I have copied the code for this button.

The purpose of the button is to save the excel sheet at a specific location,
and to save it. I want a prompt box to appear, which asks what name the user
wants to save it as. Usually this name will be the date.

I am getting this message:
Message: Run time error: '424'
Debug = MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the
File Name
----------------------------------------------------------------------------
---------------------------------------------------------

Private Sub CommandButton1_Click()
MyPath = "s:shared\Enforcement, Enquiry & Complaints"                 'Set
the Path
MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the File Name
MySaveString = MyPath & MyFileName       'String the two together

ActiveWorkbook.SaveAs Filename:= _
MySaveString, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

Private Sub UserForm_Initialize()
Me.TextBox1 = Date
End Sub
Private Sub TextBox1_Change()

End Sub

----------------------------------------------------------------------------
-------------------------------------------------------------

Please help




0
ravisandhu (10)
2/5/2004 8:22:54 PM
excel 39879 articles. 2 followers. Follow

2 Replies
611 Views

Similar Articles

[PageSpeed] 53

Hi Ravi,
Textbox1 is an object.
Change MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the
File Name
to: MyFileName = "MyName" & UserForm1.TextBox1.text & ".xls"    'Create the
File Name


-- 
John
johnf 202 at hotmail dot com


"Ravi Sandhu" <ravisandhu@mail.com> wrote in message
news:J7zUb.155$163.111@newsfep1-gui.server.ntli.net...
| I have copied the code for this button.
|
| The purpose of the button is to save the excel sheet at a specific
location,
| and to save it. I want a prompt box to appear, which asks what name the
user
| wants to save it as. Usually this name will be the date.
|
| I am getting this message:
| Message: Run time error: '424'
| Debug = MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the
| File Name
| --------------------------------------------------------------------------
--
| ---------------------------------------------------------
|
| Private Sub CommandButton1_Click()
| MyPath = "s:shared\Enforcement, Enquiry & Complaints"                 'Set
| the Path
| MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the File
Name
| MySaveString = MyPath & MyFileName       'String the two together
|
| ActiveWorkbook.SaveAs Filename:= _
| MySaveString, FileFormat:= _
| xlNormal, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
| End Sub
|
| Private Sub UserForm_Initialize()
| Me.TextBox1 = Date
| End Sub
| Private Sub TextBox1_Change()
|
| End Sub
|
| --------------------------------------------------------------------------
--
| -------------------------------------------------------------
|
| Please help
|
|
|
|


0
me5306 (285)
2/5/2004 10:13:37 PM
Hi Ravi
you're trying to use the object reference in the string concatenation.
Try
MyFileName = "MyName" & UserForm1.TextBox1.text & ".xls"

HTH
Frank

Ravi Sandhu wrote:
> I have copied the code for this button.
>
> The purpose of the button is to save the excel sheet at a specific
> location, and to save it. I want a prompt box to appear, which asks
> what name the user wants to save it as. Usually this name will be the
> date.
>
> I am getting this message:
> Message: Run time error: '424'
> Debug = MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"
> 'Create the File Name
> ---------------------------------------------------------------------
-------
> ---------------------------------------------------------
>
> Private Sub CommandButton1_Click()
> MyPath = "s:shared\Enforcement, Enquiry & Complaints"
> 'Set the Path
> MyFileName = "MyName" & UserForm1.TextBox1 & ".xls"    'Create the
> File Name MySaveString = MyPath & MyFileName       'String the two
> together
>
> ActiveWorkbook.SaveAs Filename:= _
> MySaveString, FileFormat:= _
> xlNormal, Password:="", WriteResPassword:="", _
> ReadOnlyRecommended:=False, CreateBackup:=False
> End Sub
>
> Private Sub UserForm_Initialize()
> Me.TextBox1 = Date
> End Sub
> Private Sub TextBox1_Change()
>
> End Sub
>
> ---------------------------------------------------------------------
-------
> -------------------------------------------------------------
>
> Please help


0
frank.kabel (11126)
2/5/2004 10:17:04 PM
Reply:

Similar Artilces:

Do not Email Button
Folks, can anyone tell me if there is a way to insure that a contact marked as do not email, using the radio button on their record, does not get emailed? thanks Pat No this does not work consistently throughout the system. I believe it has been logged as a bug but no resolution has been provided as far as I am aware. "Phifunk" <Phifunk@discussions.microsoft.com> wrote in message news:DD32EE5B-4BCD-419F-BA5E-FBE7A31843E1@microsoft.com... > Folks, > > can anyone tell me if there is a way to insure that a contact marked as do > not email, using the radio button...

Cannot Add Error Bars for individual data points!
I work in a research lab, and need to make a simple column chart. However, each column is an average value so error bars are needed. Not only that, but I have subsets of data-the same readings taken at different times. Thus I have Null and Dose readings for 0 hours and 24 hours. I have nicely gotten the 0 hour and 24 hour sets to become set apart in the graph display with the proper Null and Dose values next to each other. The 0 and 24 hours are written under the pairs of bars. However, I need to add error bars to each bar individually, but Excel will only let me add to "series&quo...

error messages #14
i am getting error messages while trying to send emails one is "unspecified error" and the other is "interfaced not registered" -- live long and prosper What version of Outlook are you using? -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Squibbly" <anti@spam.com> wrote in message news:ipqdnaRc...

Error 3401
I get "Cannot open a database created with a previous version of your application" when I attempt to open older mdb files. Compact cannot open them, nor can jetcomp.exe. These are simple databases created with a previous version of Access, why can't they be opened? Here are a couple of links which appear to deal with the problem you report: ACC2000: Cannot Open an Access 97 Database in Access 2000 http://support.microsoft.com/default.aspx?scid=kb;en-us;310804 ACC2000: Error Message When You Link Access 2.0 Tables http://support.microsoft.com/default.aspx?scid=kb;EN-US;2084...

MSExchangeAL 8270
Hi there, We have Exchange Server 2003 and Exchange 5.5 in mixed mode. Our Exchange 5.5 has an X.400/DirRep Connector with our subsidiary company's Exchange 5.5 on an NT Domain. The subsidiary is using a different SMTP address space. Recently we plan to migrate all users, mailboxes and other resources from our subsidiary company to our central AD and eliminate the NT domain. We have created an OU for the migrated users and an Exchange recipient policy to stamp their original SMTP address for that OU (They will keep using the original e-mail address and will not use our mother co...

Option Buttons/Radio Buttons
Hi I run Excel 2000 I have 2 option buttons in each row (total of 20 rows) I would like the only one of the 2 buttons in each row are on or off. The problem I am having is that it dosent matter which button on which row I select, only that button is active. All the other buttons go blank. I have tried changing the source for each pair of buttons but when I do all the other button sources change as well. How do i set up the buttons so that I can select one of the 2 in every row.? Example 20 buttons in total - 10 buttons active and 10 buttons inactive Thanks John You have to grou...

Moving a Button in a Dialog
I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN) pBtnOK->GetWindowRect( &Rect ) Rect.left += 1 Rect.right += 1 pBtnOK->MoveWindow( &Rect, TRUE) Thanks in advance. Rahvin wrote: > I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command: > > CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN); > pBtnOK->GetWindowRect( &Rect ); > Rect.left +...

Error number: 0x80090008 Cannot load page.
Having trouble accessing MS update and Defender update pages. Using IE 7.0.5730, XP SP3...tried the renaming SoftwareDistribution folder, restarting, manually downloading virus updates, but still no access to the MS pages. For now I am waiting, assuming it's an MS-side issue. Did not find other hits for this particular error code. Thanks for any help. beer wrote: > Having trouble accessing MS update and Defender update pages. Using > IE > 7.0.5730, XP SP3...tried the renaming SoftwareDistribution folder, > restarting, manually downloading virus updates, but sti...

Error receiving attatch message in exchange 2007
Hello!! Some messages with attachment send are delivered with this error. What can I do to solve this problem ? EXCHANGE 2007 STANDARD > <A88C27538D3D684583DC691BF6A1399902C25FA53D@srveX.domain.local> > <A88C27538D3D684583DC691BF6A1399902C25FA53F@srvex.domain.local> > <A88C27538D3D684583DC691BF6A1399926D2B59712@srvex.domail.local> > X-Priority: 3 > MIME-Version: 1.0 > Content-Type: multipart/related; type="text/html"; > boundary="b1_1a443991e78ad4af823e15cd107a2054" > X-Sender: <user...

Settings Button , Customize Button and Service Calendar
Here are the links you can put inside the outlook client to access this menu's inside outlook without having to use the web client to make the changes in your organization Just creat a new folder in the CRM structure ( or not ) , in the properties windows ( homepage ) Insert the following info. Settings http://crm:port/tools/home_tools.aspx?pid=0 System Customization http://crm:port/tools/systemcustomization/systemcustomization.aspx?pid=0 Service Calendar http://crm:port/sm/home_apptbook.aspx You have to creat a folder for each link . Im using this , i dont know if microsoft recommen...

Missing Send Button #3
My kids messed up something in Outlook. I have XP Hmoe and office 2000. My outlook works fine (under my user) but my wife's is now missing the send button in the toolbar. Thus seh cannot send emails. I cannot check the response toolbar under customize. Do I need to uninstall then reinstall or is there a way to fix it without having to do that? Thanks for any help anyone can offer. Is her mail account installed and working? Does reinstalling the account clear up the situation? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. D...

Radio Button
I have a form someone created in Excel and somehow three buttons are linked together so that if I click on one, it selects the one I click on and clears one selected before. Is there a way to have it clear the button that was selected if I click on the same button again. As it is, I cannot clear all the buttons once a button is selected. Hi This is what radiobuttons (option buttons) are for. Either Male or Female, no None or Both or Not sure yet or Refuse to answer. For independent choices (Vegetarian, Blonde, Plays guitar, ... ) use checkboxes. HTH. Best wishes Harald "Debb...

Purchase Order Entry Error Message
While in version 8.0g34 and Purchase Order Entry window opened. User accidentally minimized the window instead of closing the window. User closed window while minimized and the following message appeared. Unhandled script exception Object has no reference EXCEPTION_CLASS_SCRIPT_BAD_PARAM OK User clicks ok approx. 10 times and the window finally closes. Why does this happen? Perhaps a fix should be applied. Thanks! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree...

Error when creating new contact
Hi! When creating a new contact directly from the contact "module" everything works just fine. but when we try to create a new contact directly from an account (so the values from the account get adopted to the contact), I get an error message that gives me two options; "try again" or "Cancel" Further on, the error message just says "Something went wron, please contact your system administrator". is there any place I can read a detailed log, to get information about what is wrong? Do you have any ideas what this can be? Thanks! Activate the deb...

Why are there always multiple error popups when fetching the mail fails?
Alas my provider has a very unreliable infrastructure and so fetching my email very often fails (tyoical error messages are "timed out", "currently unreachable", "access refused", "access blocked by another server", and what not...). But what starts really driving me nuts is, that - when Outlook is unable to fetch the email - I always get 5 and sometimes up to 10 subsequent error popups that I have to click away. Why is that so? Why can't there be just a single summarizing alert saying that it tried, say, 5 times and failed. Why does Outlook (2002, ...

Buttons Issue with Access 2007 on Vista
Hi there! I have a client who has a simple access DB. If he runs it onXP/Access 2007 no issue, but if he runs it on vista/access2007, he can't click any of the buttons on any of theforms! Could someone shed some light please?...

ERROR (0X800CCCF0) when sending and receiving
why????? Outlook has read my mail from Optonline and Road Runner, but not hotmail. ??? Stu Free Hotmail is no longer available thru Outlook unless you pay for Hotmail Plus. "stu07410" wrote: > why????? Outlook has read my mail from Optonline and Road Runner, but not > hotmail. ??? Stu ...

Moving SQL Databases to another drive results in error
I am trying to move the CRM SQL Databases to another drive that has more space and I get a replication error. Is there any documentation to help me move these successfully?? McKenzie This is a multi-part message in MIME format. ------=_NextPart_000_005D_01C5A44F.29F39C90 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: quoted-printable you can do this but you need to disable replication and re-enable = afterwards Use SQL Enterprise manager, select the database you want to move and = then=20 choose the option (after right click) to detach the database,then ...

Outlook Custom Button
Hi All, Is there a way to add a custom button to Outlook 2003 SP-2 standard tool bar and have it replicate to all the users in the domain? Thanks CG You'd need to add it using a script or vba and push it out via a logon script. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Cen...

MsgBox when an Error occurs
Is there a way that I can have a message box display when an error is received while running a Macro? Vick You need to trap the error and display the message. Example Sub Test() On Error Goto errHandler 'more code Exit Sub errHandler: Msgbox "some message" End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Vick" <Vick@discussions.microsoft.com> wrote in message news:DD79DEE4-52B6-4D7E-A69D-8F8E42A666E8@microsoft.com... > Is there a way that I can have a message box display when an error is > received while...

CRM 3.0 Installation error 11-28-05
I am getting an error when CRM tries to create the root business. My client is using an OU within an OU, installing under the domain admin account. As soon as I can I am going to go over their setup one more time to make sure permissions are all in place, but has anyone else run into this error? Error| Install exception.System.Exception: Action Microsoft.Crm.Setup.Server.ProvisionBusinessAction failed. ---> System.Runtime.InteropServices.COMException (0x80044151): Exception from HRESULT: 0x80044151. at Microsoft.Crm.Platform.ComProxy.CBizOrganizationClass.IBizOrganization_Create...

Superscript Button and Subscript Button
I am trying to customize my toolbars, and I can't seem to find the superscript or subscript command. Is there a way to make the superscript and subscript commands into a button in Excel? "=?Utf-8?B?U2xvdGg=?=" <Sloth@discussions.microsoft.com> wrote in news:3D6FC2A9-56DD-49DD-B2A3-0DC028A12184@microsoft.com: > I am trying to customize my toolbars, and I can't seem to find the > superscript or subscript command. Is there a way to make the > superscript and subscript commands into a button in Excel? > Record a macro for each and tie them to buttons. ...

Problem with VBA code on command button
I have a form that has a combo box to select a month. The name of the combo box is txtmontha (I realise it would have been better to name it cmb???) The is a command button that when clicked should open a form where the date selected from the combo box is the same value as the date on the form. Here is the code behind the command button: Private Sub cmdopenrecord_Click() On Error GoTo Err_cmdopenrecord_Click Dim strqtr As String strqtr = Me.txtmontha.Value Forms!frmMain!SubForm1.SourceObject = "frmFDA" Forms!frmMain!SubForm1.Form.RecordSou...

Recording a command button name
I have an application where the user is prompted to save when they leave the the data entry form either by previewing a report of the data or by closing the form completely. There are two buttons a user can use to do this cmdPreview or cmdClose. I use a module to promt the user for svae. What I would like to do is differentiate to the module which button was clicked. Is there a way to do this? thanks You could take a look at Screen.ActiveControl.Name -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "E" <...

ActiveX Option Buttons
:confused: Hello, I need to know how to tell an option button what value to return. I have a group of 4 option buttons and I have linked them all to th same cell. That's when they stop working, because they all want to say 'true' o 'false' - how do I get them to return a value instead (i.e. 1-4) so can do a calculation on the value in the linked cell? Please help -- veci ----------------------------------------------------------------------- vecia's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=211 View this thread: http://www.excelfor...