Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

Back in 2004 a intern created a Visual Basic program that ran using access
and excel 2003. I am fairly new to Visual Basic and want to implement into
Office 2007. What, if any, are the major differences in code between 2003 and
2007?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Visual Basic and Excel 2003 and 2007?

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things have
changed slightly (such as FileSearch no longer works). But all of these are
relatively minor. The big problem lies in the way things work in 2007, the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very different
and so on and so on. These may impact on your applications, they might not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using access
and excel 2003. I am fairly new to Visual Basic and want to implement into
Office 2007. What, if any, are the major differences in code between 2003
and
2007?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

Sounds great. Here is the particular part of the code i am haveing problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things have
changed slightly (such as FileSearch no longer works). But all of these are
relatively minor. The big problem lies in the way things work in 2007, the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very different
and so on and so on. These may impact on your applications, they might not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using access
and excel 2003. I am fairly new to Visual Basic and want to implement into
Office 2007. What, if any, are the major differences in code between 2003
and
2007?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Visual Basic and Excel 2003 and 2007?

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

It could be i am not terribley sure. The chart is based off a user preference
but the data for it is drawn from a database where i work. Would it be easier
if i just picked a chart to use instaed of having it as a user preference?

"Bob Phillips" wrote:

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Visual Basic and Excel 2003 and 2007?

It would be a good idea IMO. It would certainly get you started.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"playerbigdog" wrote in message
...
It could be i am not terribley sure. The chart is based off a user
preference
but the data for it is drawn from a database where i work. Would it be
easier
if i just picked a chart to use instaed of having it as a user preference?

"Bob Phillips" wrote:

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"),
_
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"),
_
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of
these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been
re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in
message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to
implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Visual Basic and Excel 2003 and 2007?

Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...
I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:

Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...
I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

Ok, I ran into one more snage. I am trying to set up the sorted columns. Can
you tell if there is anything wrong with the code the Selection.Sort area?

Range("C2:E8760").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("L1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("M:M").Select
Selection.Sort Key1:=Range("M1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("M1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("N:N").Select
Selection.Sort Key1:=Range("N1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

"playerbigdog" wrote:

OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:

Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...
I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:

There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...
Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Visual Basic and Excel 2003 and 2007?

You should be alright with,

Columns("L:L").Sort Key1:=Range("L1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom

Does the code you posted not work or raise an error?

Cheers
Andy

playerbigdog wrote:
Ok, I ran into one more snage. I am trying to set up the sorted columns. Can
you tell if there is anything wrong with the code the Selection.Sort area?

Range("C2:E8760").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("L1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("M:M").Select
Selection.Sort Key1:=Range("M1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("M1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("N:N").Select
Selection.Sort Key1:=Range("N1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

"playerbigdog" wrote:


OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:


Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:


There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?





--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

It just raised a run-rime error but i will try your code and see how it works.

"Andy Pope" wrote:

You should be alright with,

Columns("L:L").Sort Key1:=Range("L1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom

Does the code you posted not work or raise an error?

Cheers
Andy

playerbigdog wrote:
Ok, I ran into one more snage. I am trying to set up the sorted columns. Can
you tell if there is anything wrong with the code the Selection.Sort area?

Range("C2:E8760").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("L1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("M:M").Select
Selection.Sort Key1:=Range("M1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("M1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("N:N").Select
Selection.Sort Key1:=Range("N1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

"playerbigdog" wrote:


OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:


Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:


There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?





--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Visual Basic and Excel 2003 and 2007?

When i try to put the code into the system and run it; I get the an error
saying that it has disconnected me from the clients (I am guessing that is
the database) and then takes me straight to that piece of code when i click
debug. Why is it disconnecting?

"Andy Pope" wrote:

You should be alright with,

Columns("L:L").Sort Key1:=Range("L1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom

Does the code you posted not work or raise an error?

Cheers
Andy

playerbigdog wrote:
Ok, I ran into one more snage. I am trying to set up the sorted columns. Can
you tell if there is anything wrong with the code the Selection.Sort area?

Range("C2:E8760").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("L1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("M:M").Select
Selection.Sort Key1:=Range("M1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("M1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("N:N").Select
Selection.Sort Key1:=Range("N1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

"playerbigdog" wrote:


OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:


Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
...

I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:


There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...

Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?





--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Visual Basic and Excel 2003 and 2007?

I have no idea. Can not see how that error is related to the sort part.

Do you get the error if you manually try and sort?

playerbigdog wrote:
When i try to put the code into the system and run it; I get the an error
saying that it has disconnected me from the clients (I am guessing that is
the database) and then takes me straight to that piece of code when i click
debug. Why is it disconnecting?

"Andy Pope" wrote:


You should be alright with,

Columns("L:L").Sort Key1:=Range("L1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom

Does the code you posted not work or raise an error?

Cheers
Andy

playerbigdog wrote:

Ok, I ran into one more snage. I am trying to set up the sorted columns. Can
you tell if there is anything wrong with the code the Selection.Sort area?

Range("C2:E8760").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("L1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("M:M").Select
Selection.Sort Key1:=Range("M1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Sort Key1:=Range("M1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("N:N").Select
Selection.Sort Key1:=Range("N1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

"playerbigdog" wrote:



OK, thanks guys. I think I am getting it slowly figured out!

"Andy Pope" wrote:



Hi,

xl2007 does not support custom chart types.
You maybe be able to use the new ApplyChartTemplate method. Other wise you
will need to apply the custom formatting within the code.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob Phillips" wrote in message
. ..


I can't test that because I don't have a custom chart type of Chart_1. Is
that your problem too?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...


Sounds great. Here is the particular part of the code i am haveing
problems
with. If temp1 = 43 Or myVar3 = "43" Then
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Else
Range("B2:E8758").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Chart_1"
ActiveChart.SetSourceData Source:=Sheets(myVar1).Range("B2:E8758"), _
PlotBy:=xlColumns
Where the else starts, is where my problems start. What is the new the
chart
information?

"Bob Phillips" wrote:



There are no major differences in code in the two. 2007 has certain
additions to cope with the extended object model, and certain things
have
changed slightly (such as FileSearch no longer works). But all of these
are
relatively minor. The big problem lies in the way things work in 2007,
the
ribbon is very different than commandbars, charting has been re-written
(re-destroyed some might argue), conditional formatting is very
different
and so on and so on. These may impact on your applications, they might
not.
Only testing will tell.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"playerbigdog" wrote in message
...


Back in 2004 a intern created a Visual Basic program that ran using
access
and excel 2003. I am fairly new to Visual Basic and want to implement
into
Office 2007. What, if any, are the major differences in code between
2003
and
2007?



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
visual basic code in 2003 vs 2007 George Applegate[_2_] Excel Discussion (Misc queries) 1 October 30th 09 05:07 PM
Visual Basic module from Excel 2003 crashing in Excel 2007 Chuck Angier Excel Discussion (Misc queries) 0 December 4th 07 01:42 AM
2003--2007"programatic accses to visual basic project is not trus Miri Excel Programming 1 August 13th 07 03:26 PM
Excel 2003 visual basic help shows nothing p45cal[_50_] Excel Programming 2 May 11th 07 11:27 AM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM


All times are GMT +1. The time now is 09:09 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"