Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default open Userform in Another workbook

hi,

I am trying to open a userform in another workbook and change the value for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default open Userform in Another workbook

Userform3.c003.value= "test" works

geebee wrote:

hi,

I am trying to open a userform in another workbook and change the value for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default open Userform in Another workbook

hi,

There is already a Module in the other workbook called custForm1 which
contains the following to open the Userform3:

Sub Z()
UserForm3.Show
End Sub

I just am not sure of the syntax now, becausae I am getting an error message
witrh the following:

Application.Run "Z"

Am I missing something?

Thanks in advance,
geebee

"Bob Phillips" wrote:

What you need to do is have a small macro in that other workbook that shows
the userform, then run that macro using Application.Run.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"geebee" wrote in message
...
hi,

I am trying to open a userform in another workbook and change the value

for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default open Userform in Another workbook

Application.Run "'another book2.xls'!Z"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"geebee" wrote in message
...
hi,

There is already a Module in the other workbook called custForm1 which
contains the following to open the Userform3:

Sub Z()
UserForm3.Show
End Sub

I just am not sure of the syntax now, becausae I am getting an error

message
witrh the following:

Application.Run "Z"

Am I missing something?

Thanks in advance,
geebee

"Bob Phillips" wrote:

What you need to do is have a small macro in that other workbook that

shows
the userform, then run that macro using Application.Run.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"geebee" wrote in message
...
hi,

I am trying to open a userform in another workbook and change the

value
for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default open Userform in Another workbook

hi,

I now have...

Workbooks.Open "filename.xls"
Application.Run "filename2.xls'!Z"
CustFilter.c003.Value = "test"

I noticed that the fields value is not changing to "test" . The form is
modal. Does that have anything to do with it?

Thanks in advance,
geebee



" wrote:

Userform3.c003.value= "test" works

geebee wrote:

hi,

I am trying to open a userform in another workbook and change the value for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default open Userform in Another workbook

I put this routine in the workbook with the userform:

Option Explicit
Sub ShowIt(myVal As String)
Load UserForm1
UserForm1.ComboBox1.Value = myVal
UserForm1.Show
End Sub

I saved and closed that workbook (as book1.xls).

Then I used this code to open and show the form:

Option Explicit
Sub testme()
Dim wkbk As Workbook
Set wkbk = Workbooks.Open(Filename:="C:\my documents\excel\book1.xls")
Application.Run "'" & wkbk.Name & "'!Showit", "xxxx"
End Sub


geebee wrote:

hi,

I am trying to open a userform in another workbook and change the value for
one of the comboboxes in that Userform... Here is what I have..

Workbooks.Open "E:\Path\filename.xls"
UserForm3.Show vbModal
c003.Value = "test"

It is not working!

Can someone help?

Thanks in advance,
geebee


--

Dave Peterson
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
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
How do you make a userform open automatically when you open excel? Evan Excel Worksheet Functions 1 March 11th 10 02:24 AM
Opening Excel, Book1 opens, remains open with other workbook open DanieB Excel Discussion (Misc queries) 0 September 3rd 09 08:23 AM
how do i open a data workbook when i open a timesheet workbook [email protected] uk Excel Discussion (Misc queries) 2 January 4th 09 04:50 PM
How do you program so that Workbook B cannot be open unless Workbook A is open? Plus I need to validation Marcello do Guzman[_3_] Excel Programming 2 December 5th 04 06:50 AM


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