Home » Developer & Programmer » Forms » Export Data From Excel and save on an existing excel file (Developer Forms, 6i, Windows Xp)
Export Data From Excel and save on an existing excel file [message #611328] Tue, 01 April 2014 07:18 Go to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Hi Guys,

I have successfully created a mechanism in my forms that can export my data from Oracle to an Excel file.

But the problem is that I want to save this excel file on an already existing file. Basically I want to over right the excel file name if it already exists.

I am using OLE2 package.
Re: Export Data From Excel and save on an existing excel file [message #611354 is a reply to message #611328] Tue, 01 April 2014 14:54 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What happens when you do it? Does Windows complain (such as "do you want to ...") or does Forms fail (with which error, if so), or ...?
Re: Export Data From Excel and save on an existing excel file [message #611370 is a reply to message #611354] Wed, 02 April 2014 01:05 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Yes it is showing following Excel save alert:

Windows Alert Title = Miscroft Excel

Windows Alert Message = A file named 'C:\My_Excel_Data.xls' already exists in this location. Do you want to replace it?

I don't want Windows to show me this alert. I want to overwrite this file on the existing file.
Re: Export Data From Excel and save on an existing excel file [message #611394 is a reply to message #611370] Wed, 02 April 2014 02:50 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Then first DELETE file C:\My_Excel_Data.xls (use HOST built-in which calls DEL operating system command). If it exists, it will be deleted. If not, nothing will happen.
Re: Export Data From Excel and save on an existing excel file [message #611402 is a reply to message #611394] Wed, 02 April 2014 04:20 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear Friend LittleFoot,

Thanks for your quick reply. Its been along time.

Is there any other way rather then issuing the Host delete OS command. I mean is there any way using OLE2 can save a file without asking to file already exists.

And if I use the Host delete Os command then don't you think that it will also confirm before deleting the existing Excel file.
Re: Export Data From Excel and save on an existing excel file [message #611404 is a reply to message #611402] Wed, 02 April 2014 04:27 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't use OLE2 so I can't suggest anything about it.

DEL won't ask for confirmation:
M:\>del test.txt

M:\>
(TEST.TXT was just deleted - no questions have been asked).
Re: Export Data From Excel and save on an existing excel file [message #611413 is a reply to message #611404] Wed, 02 April 2014 05:10 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Ok I am going to test it. Cool Don't go any where
Previous Topic: Developer 10g
Next Topic: Filter in an LOV
Goto Forum:
  


Current Time: Tue May 07 02:54:18 CDT 2024