How To Update VBA Code In Embeded Object In Table

G

Gary

I have a table with about 80 records and one OLE Object field. Embed in
that OLE Object field is a Visio drawing with VBA Code inside the Visio
application. How can I upated the VBA code without changing the Visio
drawing itself from Access???

Is it possible when I activate the embeded object in Access and copy in new
VBA code???

Or Should I make a duplicate copy of the table with the OLE object field
updated with a new Visio dirawing and copy and paste from One table to
another??? I assume when I copy and paste, it will only be the drawing and
now the VBA code behind???


Thanks,

Gary
 
G

Gary

I have a few addition questions on this process (from your link).

1) An Excel OLE Obj window is open (either in place or in a separate
window). Is there a way to hide this window?? It becomes ignoring when you
cycle through 80 of these.

2) I could use acOLECopy instead of the action acOLEActivate??? and then
paste it into the new table (the new table will have the new visio template
or in your example the new excel template with new updated macros).

If I need to change which layers are visible on the embed object, do I need
to activate (like what your example did) before I can change which layers are
visible and no-visible????

If I do need to activate, can you show me how to hide that window from
poping up or hide it with something??

If I left a version of Visio or Excel open (i.e. use CreateObject), would it
be faster when I activate each of the records which has the OLE Object???


Thanks You,

Gary
 
A

Alex Dybenko

Hi Gary,
1) An Excel OLE Obj window is open (either in place or in a separate
window). Is there a way to hide this window?? It becomes ignoring when
you
cycle through 80 of these.

i think you can try to hide form, make it Visible property=false
If I need to change which layers are visible on the embed object, do I
need
to activate (like what your example did) before I can change which layers
are
visible and no-visible????
yes

If I left a version of Visio or Excel open (i.e. use CreateObject), would
it
be faster when I activate each of the records which has the OLE Object???

Well, perhaps this can be faster, but depends on how Visio handle this, you
have to try.

In general - I don't know your whole idea, but I think the better idea - is
to store Visio drawings as files on hard drive, or as binaries in access
table, this how we normally make such solutions

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
G

Gary

What do you think would be the best approach in storing the drawings??

I have 80 records, and each record has text or number fields. There is only
1 OLE Object field used to show a unqiue drawing for each record. There will
be 80 unique drawing. I currently created a form for entering the various
fields for the data. There is also a bounded Object frame used to allow the
drawing to be done by double clicking on the OLE Object and the application
opens up in its own windows (visio in my case) on the Access Form. The user
can draw his drawing while he is still entering data for that given
recordset. We use a pen to electronically draw our drawing on the screen.
Since its a database, we can do various queries on the recordset and come up
with certain recordset that I need converted over to power point.

Before going over to power point, the user has the ability to select which
layers he want visible on drawing for the power point. He also makes the
decision if he wants to flip the image too before we make the power point.
The reason to go over to power point was to print a slide show and the
ability to slide edit the presentation before printing easily. If I could
have created my own slide editor (the way power point has), we would have
keept everthing in Access. The drawing would still be in visio.

If I kept all of the drawings on a file on hard drive during the data entry
and drawing phase, I would need to link the location back to the OLE Object
frame. I think the difference would be either a bounded or unbounded object
will be required (no sure which right now). The user will go back and review
the data for each record and change the drawing if it didn't match some of
the conditions in the recordset. The user will still double click the OLE
Object frame to activate the Visio drawing and make the changes. So I am not
sure if it was better to embed or link the drawings here??? I think the
amount of storage space was the same.


What would you recommend as a possible approach to this problem???

What do you normally do for such problems????

I appreicate any suggestions you may offer!!!!

Thank You,

Gary

P.S. Making the form invisible doesn't work (first question above) because
when you activate with a Verb=2 on the access bound object frame - it opens
up a separate Visio Window. I want to hide the visio windows coming up and
closing was a sequence through the table. If I can change the Visio layers
properties of the drawing without activiating, then I don't have that window
coming up. I have been trying to hide this for a while. I also tried
making a form alway on top, and that doesn't work either the the activation
us a UI window.
 
A

Alex Dybenko

Hi Gary,
ok, I understand your approach, but still think that storing Visio drawing
as a file will be better, you can store a full file path in database, to
open it you can use either ShellExecute API or open Visio via CreateObject()
and then open your drawing there.

From my experience - storing office files as OLE Objects in database is not
a reliable solution, I always recommend to avoid it

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
T

TC

If all the files are in the same folder, I'd just store their names -
not their paths. Get the path from somewhere else, eg. a global
variable, or a registry setting. Then he can easily move the files to
another directory, without having to edit the data.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Gary

I am thinking o using your suggested approach!! I have a question on how I
should approach the problem. I have a comma delimited database that I get
and I down load the data into my table. The amount of data in that database
determines the number of records I have.

I next put in the standard embed object template (visio) into the OLE field.
My use then start filling in addition data for each record and does the
drawing.

I was thinking of making a butch of these visio template files and storing
them in a folder. The folder will have the same name as the database except
inside this folder there will be all of the visio drawings.

That means in my table, I will be creating a link to this folder and the
individual visio drawings. That means the location of the visio folder can
be moved around because that will break the link and would could me to
reconnect the link.

Is this the approach you would suggest????

From an educational reason, can you tell me why its not recommend to embed,
but separate the ole object (visio) in its own folder??? Is it because it
really stored in disk while having it embeded, I am depending on another
application to store the data??

I really appreciate your help.

Gary
 
G

Gary

Now comes the question on to add the objects as linked objects within my Table.

I was able to create all of the drawing on a folder with sequential names.
I can't figure a way of adding the drawing file as an linked object in my
table.

Can you help!!!

I also tried using a form with unbounded object frame with the form
connected to the table for adding the linked objects. I was able to change
the property of the frame to point the the individual files. I can see it in
the small frame I have on the form. I also did the .Action =
acOLECreatedLinke but it doesn't do it form me on the table.

Can I get a little help!!!

Thank you!!!!!

Gary
 
G

Gary

I didn't try putting the full path in a table field yet. Don't know how that
would work?

I did do the followng that didn't work for me (almost like article #209990
in the knowledge base). I have a form which is connected to a table (which
I have tried to like an object in). I put a unbound object frame, and made
sure the enable = True and locked = False. I also set the SourceDoc =
fullpathname of the file to be linked. This incudes the filename at the end.
I made sure the frame has oletypeallowed = acOLELinked or both.
Aftwardward, I set the .action of the frame to .Action = acOLECreatelLink and
I see the from with its frame showing the different files going by.
Afterward, I look at the table and it is still empty!!!!

I really appreciate any help here!!!


Thank You,

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top