View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 230
Default Visualization problem .xls file with office 2007

perf wrote:
yes, I think he meant to split in that way the code for excel 2007 and excel
2003.

by the way, this is not true solution of the problem in my case, because I
should open in 2007 files created before in office 2003... so I have the same
problems, also with code fork.

so, I have been forked. ahi! : (


Depending on how much of a hit you can stand on the graphics speed if
one copy *has* to work on both you can determine which XL version at
startup and then create your own versions of each shape drawing routine
used that does the right thing based on a global boolean XL2003.

eg. (untested)

Sub MyAddline(s As Shape, tx, ty, bx, by)
if XL2003 then
s.Addline(tx,ty,bx,by)
else
s.Addline(tx,ty, tx+bx, ty+by)
endif
end sub

etc.

Regards,
Martin Brown



"JLatham" wrote:

I believe he means to determine the version number for the copy of Excel that
is running and taking 2 paths depending on what version you're using:

If Val(Application.Version) = 12 Then
'code for Excel 2007 (and presumably 2010) here
Else
'code for pre-2007 versions of Excel here
End If

Perhaps he meant to fork the code before it forks you?? Which it seems to
have already done.

"JLGWhiz" wrote:

'You have to fork the code'

Another technical term with which I am unfamiliar.