Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have transferred some vba code form a desktop running excel 2002 to a new
laptop running excel 2003 and when I run one of the forms I get the error message "Could not load some objects because they are not available on this machine" I have checked the Tools/ References and they are both the same on each machine. Could someone tell me what is missing please and how do I find it? Thanks Chris |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Further to my enquiry, I think the problem is a "Commondialog" control. I
originally got this from a website but have since mislaid the reference. I recall I had to set a additonal control to Toolbox/Controls but can't remember how. Perhaps someone knows of the website and could point me to it? The code which works fine on the desktop pc (excel 2002) is : Private Sub CommandButton1_Click() bOK = True Me.Hide End Sub Private Sub CommandButton2_Click() bOK = False Unload Me End End Sub Private Sub CommonDialog2_Enter() End Sub Private Sub UserForm_Initialize() Dim d1 As String d1 = CurDir TextBox26.Value = d1 ChDir d1 End Sub Private Sub chngDir_Click() Dim sMyNewDirectory As String Dim stempdir As String dirSelect.Show stempdir = CurDir On Error Resume Next CommonDialog2.DialogTitle = "BROWSE to the datafile directory, double click on it and press SAVE" CommonDialog2.InitDir = app.path CommonDialog2.Filename = "DOUBLE CLICK on directory then press SAVE" CommonDialog2.flags = cdlOFNNoValidate + cdlOFNHideReadOnly CommonDialog2.Filter = "Directories|*.~~~" CommonDialog2.CancelError = True CommonDialog2.ShowSave If Err < 32755 Then sMyNewDirectory = CurDir End If ChDir stempdir TextBox26.Value = sMyNewDirectory End Sub Private Sub GetstkFile() CommonDialog1.InitDir = TextBox26.Value & "\" CommonDialog1.DialogTitle = "Saved file name" CommonDialog1.Filter = "File name (*.xls)|*.xls" CommonDialog1.DefaultExt = ".xls" CommonDialog1.ShowOpen TextBox25.Value = CommonDialog1.Filename End Sub Private Sub browseSF_Click() GetstkFile End Sub Private Sub dirSelect_Click() End Sub Thanks Chris |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"inquirer" wrote:
I have transferred some vba code form a desktop running excel 2002 to a new laptop running excel 2003 and when I run one of the forms I get the error message "Could not load some objects because they are not available on this machine" I have checked the Tools/ References and they are both the same on each machine. Could someone tell me what is missing please and how do I find it? Thanks Chris I'd be sure that there is a problem locating the source for a control which could be stored in a .OCX file such as MSCOMCT2.OCX. If the library is present on your laptop, it could be that it needs registering with REGSVR32. At a command prompt, type something like REGSVR32 MSCOMCT2.OCX. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think the problem is that on my desktop I have VB loaded but it is not on
the laptop. So is it possible to identify the OCX? that is required and copy it to the laptop and then register it? Or is there more to it than that? Thanks Chris "bigwheel" wrote in message ... "inquirer" wrote: I have transferred some vba code form a desktop running excel 2002 to a new laptop running excel 2003 and when I run one of the forms I get the error message "Could not load some objects because they are not available on this machine" I have checked the Tools/ References and they are both the same on each machine. Could someone tell me what is missing please and how do I find it? Thanks Chris I'd be sure that there is a problem locating the source for a control which could be stored in a .OCX file such as MSCOMCT2.OCX. If the library is present on your laptop, it could be that it needs registering with REGSVR32. At a command prompt, type something like REGSVR32 MSCOMCT2.OCX. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"inquirer" wrote:
I think the problem is that on my desktop I have VB loaded but it is not on the laptop. So is it possible to identify the OCX? that is required and copy it to the laptop and then register it? Or is there more to it than that? I use the date picker which is contained in MSCOMCT2.OCX so if you know that there is a control on a user form which is not part of the "normal" set of controls, you can find the library name as follows:- In the VB editor, click on ViewToolbox. Then, right click on a blank part of the toolbox and select Additional Tools. You will next see a dialog containing a list of available controls and the library file is shown when you click on the descriptions (some are .dll, some .ocx). Check which ones you have on the desktop and make those libraries available on your laptop. Then register them, if necessary. HTH |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have done that and the additional tools that are checked are identical on
both systems. Looks as tho I'll have to fins another way round this. Chris "bigwheel" wrote in message ... "inquirer" wrote: I think the problem is that on my desktop I have VB loaded but it is not on the laptop. So is it possible to identify the OCX? that is required and copy it to the laptop and then register it? Or is there more to it than that? I use the date picker which is contained in MSCOMCT2.OCX so if you know that there is a control on a user form which is not part of the "normal" set of controls, you can find the library name as follows:- In the VB editor, click on ViewToolbox. Then, right click on a blank part of the toolbox and select Additional Tools. You will next see a dialog containing a list of available controls and the library file is shown when you click on the descriptions (some are .dll, some .ocx). Check which ones you have on the desktop and make those libraries available on your laptop. Then register them, if necessary. HTH |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
I used "save as" but now can't locate original file | Excel Discussion (Misc queries) |