View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
exceluserforeman exceluserforeman is offline
external usenet poster
 
Posts: 45
Default Excel 2002 to 2007 - issues with Macro / VB?

I f you do not use the reference type "textbox1.text" but just "textbox1"
this may cause errors.
eg:
strMyText=textbox1.text returns the text in the textbox but
strMyText=textbox1 may actually dimensionalise strMyText as textbox1. VB7 and
Excel 2003 and up (ie 2007) needs complete reference types. Yes they might
work the shortcut way but complex coding may confuse the ref type and
unexpected errors may occur. It is also ggod coding to use the correct ref.
Also Make sure all the "Dim"s are at the top not stuck half way through the
code. ReDim is the only one I know that is used anywhere in the code. Dim as
much as possible. Try to avoid variants ie if it is an integer.

Try not to Dim objects like textbxes, listboxes etc.. Many people do but it
is not necessry.



"Don" wrote:

I will be testing the new Office 2007 to make sure things work for our
company. I have created many macro's many people are using and wonder if
anyone can tell me of anything/issues to look out for. I know that you have
to save it as a certin format to save the Macro's , but my VB code in the
files are a bit complex so not just record and play.