Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default In VBA: how to open a workbook with a specific version of excel?

Hi,
I have Office 2003 and 2007 on my computer. I've written code in VBA (Excel
2003)for opening a workbook if the file exists. If not, a new workbook must
be created.
The new workbook is created and opens, but the old workbook opens a second
time in Excel 2007. How can I prevent this in VBA?

Code:
If fileExists("filename") then
Set nWB = WB.Open("filename")
Else
Set oWB = active.workbook
oWB.save
oWB.saveCopyAs ("filename")
Set nWB = wb.Open("filename")
End if
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
force excel workbook to open to a specific worksheet Wenster Excel Discussion (Misc queries) 1 June 24th 09 04:53 PM
Open a specific workbook...find value from other open workbook and then insert cells values in cell next to it. [email protected] Excel Programming 1 May 13th 07 01:46 PM
Macro - Save an Open Excel Version 4 as current version of Excel planomax Excel Programming 1 February 6th 07 09:41 PM
Open specific version of Excel Peter T Excel Programming 2 September 3rd 05 11:04 AM
How do I open each workbook in it's own version of Excel? RKOCT Excel Discussion (Misc queries) 3 December 8th 04 11:32 PM


All times are GMT +1. The time now is 04:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"