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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Excel 2007 SaveAs problem

Status
Not open for further replies.

hyarmion

Technical User
Dec 23, 2008
20
AU
Using VB (actually VB6) I am opening a tab deliminated .TAB file with Excel 2007, making a few small changes and then attempting to save it as a .xlsx file.

The code looks like

XLWorkBookName = xlApplication.Workbooks.Open(filename.TAB)
...
XLWorkBookName.SaveAs filename.xlsx, xlWorkBookNormal

The use of the xlWorkBookNormal file format parameter should, I think, cause it to save as a .xlsx file. But when I try to open the saved file with Excel 2007, am I told that the file name conflicts with the file format, and it won't open. Any ideas anyone?
 
Try this:

XLWorkBookName.SaveAs filename, xlWorkBookNormal


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top