|
-
Aug 27th, 2003, 12:41 PM
#1
Thread Starter
Lively Member
SaveAs Excel
How do i SaveAs even if the file already exists.
I have this, but i still get the "Are you sure you want to overwrite..." from Excel
oWB.SaveAs("Filename.xls" , , , , , , Excel.XlSaveConflictResolution.xlLocalSessionChanges)
How do i use the saveAs method without needing to prompt the user?
thx
db
-
Aug 27th, 2003, 12:45 PM
#2
Sleep mode
Re: SaveAs Excel
Try something like this :
VB Code:
Dim sv As New SaveFileDialog
sv.OverwritePrompt = False
-
Aug 27th, 2003, 12:47 PM
#3
Thread Starter
Lively Member
Pirate,
I'm not using a Dialog, im using the SaveAs method of the workbook object.
regards
db
-
Aug 27th, 2003, 12:51 PM
#4
Sleep mode
Sorry , got no clue about this .
-
Aug 27th, 2003, 08:42 PM
#5
do you want to save to the same file that you are working on?
If not just make a FileExist function and if the path exists delete it.
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
Aug 28th, 2003, 08:01 AM
#6
Thread Starter
Lively Member
no, diff file name
maybe i can delete the old file then saveAs, this way i wouldnt have to worry about getting prompted about the overwrite.
I think an If statement seeing if the file exists, then delete if True would do the trick.
So yeah, how do i delete a file?
thx db
-
Aug 28th, 2003, 12:10 PM
#7
Sleep mode
This is how to delete the file by passing the path & file name . I still don't get why you want to overwrite the file without promoting the user. I'm all Windows editions and all professional app behave this way . Give your user the choice and don't force him to do weird stuff .
-
Aug 28th, 2003, 12:12 PM
#8
Sleep mode
Opps , don't forget to include this at the very top of your form or a class where you'll use this function :
-
Aug 28th, 2003, 01:15 PM
#9
Thread Starter
Lively Member
P,
I'm not prompting the user because this is a program that captures write speed to Network Drives.
Thanks for the IO stuff, it works fine now
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
|