Ok. I got this code from you guys and it works fine on my computer. But, when the form is used on someone elses computer it comes up with an error message. What I did was I inserted a CommonDialog box for the save as. I think it has something to do with the path that it is saving it in. Is there a way to specify the path??? Take a look at my code and tell me what you think.
Code:Private Sub UserForm_Initialize() CommonDialog1.Filter = "Excel Spreadsheet(*.xls)|*.xls|" CommonDialog1.FilterIndex = 1 cbxEmployeeName.SetFocus cbxEmployeeName.SelStart = O cbxEmployeeName.SelLength = Len(cbxEmployeeName.Text) End SubTell me what you think and if there is anything I can do about this.Remember, I am using VBA.Code:Private Sub CommandButton7_Click() CommonDialog1.ShowSave CommonDialog1.CancelError = False If CommonDialog1.FileName <> "" Then ActiveWorkbook.SaveAs FileName:=CommonDialog1.FileName End If End Sub




Reply With Quote