Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default "Could not locate some objects...."

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default "Could not locate some objects...."

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default "Could not locate some objects...."

"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default "Could not locate some objects...."

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default "Could not locate some objects...."

"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default "Could not locate some objects...."

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
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
I used "save as" but now can't locate original file Booksmarts Excel Discussion (Misc queries) 1 December 1st 05 08:15 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"