LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Edit userform

Alright I have a program that when opened pulls up a userform. There i
a button on this form that allows you to edit the form. When thi
button is clicked the first form is unloaded and a new form comes up
This second form takes the data that you want and uses it to change th
data on the first form (well that's what I want it to do). I am usin
the following code to do this (change caption).

Dim VBC as object

Set VBC
Workbooks("3PUserFormTest.xls").VBProject.VBCompon ents("UserForm1")
VBC.Designer.Controls("ckwater").Caption = txNew

Problem: If I run it from the program window of the second form i
works fine, but if I close the program and reopen it so that the firs
form loads when I get to the second form and press okay so that it wil
run the above code it gives me an error. The error is as follows.

Run-time error '91':
Object Variable or With block variable not set

It highlights the last line of the above code, but I can't seem to fin
an error. I even placed the code into a different window and ran it b
itself. It worked fine. This has been stumping me all day. Pleas
help!

--
Message posted from http://www.ExcelForum.com

 
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
Edit exsisting data with userform Geo Excel Discussion (Misc queries) 2 October 1st 07 07:38 PM
Multiple Userform Hold Data to edit bg18461[_8_] Excel Programming 2 June 4th 04 03:10 AM
Edit a userform Debra Dalgleish Excel Programming 0 February 7th 04 01:57 PM
View Row Data in UserForm / Edit Pete T[_2_] Excel Programming 1 October 17th 03 10:36 PM
Code to edit directly in cells from userform Tom Ogilvy Excel Programming 0 September 7th 03 10:27 PM


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