Need Excel VBA To Create Excel 2007 Workbooks

ByerRA

New Member
Joined
Sep 18, 2009
Messages
22
I have an Excel 2007 .xlsm workbook with a macro that creates a workbook with a single worksheet and then imports a 150K+ lines long data file to work on.

My problem is that my macro is creating a workbook with a single worksheet in "Compatibility Mode" to import the data to and it's being cut off at the 65K limit.

How do I tell Excel 2007 VBA to create a "Excel 2007" workbook and not a "Compatibility Mode" workbook so I can import the data without it getting cut off.

Thanks in advance for any help.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Probably has to do with your default file format. Try this, at the beginning of the code:

Code:
Dim fFormat As Excel.xlFileFormat
fFormat = Application.DefaultSaveFormat
Application.DefaultSaveFormat = xlWorkbookNormal

then at the end of the code:

Code:
Application.DefaultSaveFormat = fFormat
 
Upvote 0
Sorry for the delay, been rather busy.

Nope, that didn't change a thing. The workbook still opens in compatibility mode :(

Probably has to do with your default file format. Try this, at the beginning of the code:

Code:
Dim fFormat As Excel.xlFileFormat
fFormat = Application.DefaultSaveFormat
Application.DefaultSaveFormat = xlWorkbookNormal

then at the end of the code:

Code:
Application.DefaultSaveFormat = fFormat
 
Upvote 0
That is the only way I was able to recreate the problem and fix it. I have no other suggestions - sorry.
 
Upvote 0
Why don't you specify the file format when saving the workbook(s)?

There is a FileFormat property.:)
 
Upvote 0
My problem exists before I can even put data in to save.

I have data which will exceed the excel 2003 row limit so I need to create/open a excel 2007 workbook at the start to put my data in to save.

Why don't you specify the file format when saving the workbook(s)?

There is a FileFormat property.:)
 
Upvote 0
You haven't posted any code so it's pretty hard to help.

We are basically just guessing, throwing ideas in the air etc.

Actually the first thing I would normally ask is why are you using Excel anyway when you have so many records.

I know the number of rows/columns has been increased but I really don't think it's helped things.:)
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,588
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top