Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating 1

Status
Not open for further replies.

woodrg

Programmer
Jul 25, 2003
48
US
I have a VB application that is creating an Excel file. it is used to report to an Insurance Provider, and they specifically need to be able to open it in Excel 5.0 format. They are using Visual Fox Pro 5.0 and according to my contact there, it won't read anything more current.

We however are using VB 6.0 and are working off an XP operating system with Office 2002! So they can't open our test file.

I know i can manually change it doing "save as" and choosing "Excel 5.0/95 Workbook(*.xls)" as the file type. But the whole point of creating the app is that that nothing is manual!!! Is there a way that i can choose to create the file in my application for Excel 5.0?

Here's what i have to create it:
Dim objWs As Object
Set objWs = CreateObject("Excel.Sheet")
objWs.Application.Visible = False

Then I build the data to the file, and this is how i save it:
' Save file
objWs.SaveAs DefaultPathName & DefaultEmpFileName & Format(dtpWeDate.Value, "yyyymmdd")
objWs.Close

i've sent it to them as a CSV and that has worked this time, but i can't guarantee that some of my data won't have commas due to the nature of the data. I know i can scrub the data to check for and remove any commas, but i still would rather be able to send it to them in the file format they have requested so that there is less data manipulation.

I'm just positive it's possible, i just don't know how to get to the version number. I've done some searching on this site, but i'm on a tight time frame, so i gave up. If the answer is else where, feel free to point me to it!

Thanks in advance.
 

objWs.SaveAs _
FileName:= & DefaultPathName & DefaultEmpFileName & Format(dtpWeDate.Value, "yyyymmdd"), _
FileFormat:=xlExcel5
 
thank you, thank you, thank you!!!

Becky
Alabama
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top