|
-
Sep 1st, 2000, 01:10 PM
#1
Thread Starter
Evil Genius
got there in the end
Just got home David, try this under the button_click() event :
Code:
With CommonDialog1
.ShowSave
.Filter = "*.xls"
.DialogTitle = "save as example"
End With
getfiletosave = CommonDialog1.FileName
Excel.Workbooks(0).Item.SaveAs getfiletosave
hope this helps.
Alex
-
Sep 1st, 2000, 01:21 PM
#2
Thread Starter
Evil Genius
valuable lesson
For your one, try
Code:
ThisWorkbook.SaveAs CommonDialog1.FileName
instead of the last line.
checked 3 ms sites for the filter bit, and just realised the above is c**p, maybe someone else can shed some light on this part, but the above will save your files.
-
Sep 1st, 2000, 01:24 PM
#3
Hyperactive Member
This is the code I have. This works too.
Code:
Private Sub CommandButton1_Click()
CommondDialog1.ShowSave
ActiveWorkbook.SaveAs FileName:=CommonDialog1.FileName
End Sub
Private Sub UserForm_Intitialize()
CommonDialog1.Filter = "Excel Spreadsheet(*.xls)|*.xls|"
CommonDialog1.FilterIndex = 1
End Sub
This works. Now, when the Save As dialog comes up, and I hit cancel, it comes up with a debug error message. Why is that?
Thanks Alot,
David Gottlieb
CIW Certified Internet Webmaster
Web Developer/Designer
-
Sep 2nd, 2000, 11:06 AM
#4
Thread Starter
Evil Genius
because it's made by microsoft ...
You have a line :
Code:
CommonDialog1.CancelError = False
which you can add in your CommandButton1_Click() part, or you an do a..
Code:
If CommonDialog1.Cancel = True Then
'code to cancel here
End if
statement. Note I have tried this before posting this time!
Alex Read
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|