Easy, always reliable "link" between Word and Excel?

  • Hi everyone-


    I was wondering if you could help me find information about whether it is possible to "call up" a Word doc from Excel. Is it as simple as "pushing a button" and opening the document in Word? Hmmm, is that simple? And, is there an always reliable means? Thank you-


    AA :thanx:

  • Yes, it does seem that simple to me. As always, Dreamboat, you cut straight to the chase. I like that about you. I feel inept, but it is only lack of MSperience. There is also that my boss doesn't like those little under-liney thingys created by hyperlinks. And, he wants me to design this, uh, software product in Excel. So, I need a method to link to say, any given Word doc from say, any given Excel WB, even if it is not two files on my hard drive. ie: Call Word doc A from Excel button AA in WB B. And can I just attach a macro to the Word doc that will link back? How portable are hyperlinks? Any suggestions? And thank you so much for the help you keep giving...


    AA :thanx:

  • Inept??!!


    Dude...you are learning, which is much more than many can say--those who sit there and whine "I can't do this!!" and force others to do it for them.


    :)


    YES.
    Hyperlinks is what you want.
    I don't like the underlines either.
    So I change 'em!
    Create hyperlinks.
    Select the cells and format any way you want.
    You can remove the underline, make the text bold and some other color 'sides that fugly blue.
    You can insert textboxes from the Drawing toolbar and assign hyperlinks to them.
    You can make little graphic buttons and assign hyperlinks to them.
    You can create an automatic table of contents in each and every Excel file using a macro (two ways: http://www.vbaexpress.com/kb/getarticle.php?kb_id=120 or http://www.vbaexpress.com/kb/getarticle.php?kb_id=16), and then formatting the cells with some more code.


    We can alter the macro to loop through all the files in a folder too...


    But *I* can't do it myself. I'll have to get you some help. :)
    Let me know.

  • Dreamboat, you are awesome. I do, actually, feel like I'm asking you kind experts to do it for me, but you are right, I am learning. I'll help with the whiners before I'm through. I used to get a kick outta being an "ACe" in programming forums I've been part of in the past. It's strange to be the underdog. But not to waste too much of your time, I actually have a question about hyperlinking. For some reason, I thought they worked by "tracking a path" from one file to another, which would make them highly unportable between systems. This could be solved if both files were in the same directory, of course... Do they actually work by searching a filename? What about duplicate filenames? Well- don't put yourself out if my questions are stupid; I know they are and I'm looking it up the minute I get finished thanking you. I would like to see that looping macro, if you and your friends have time...


    Thank you!!


    AA

  • No question is stupid except the one that isn't asked. LOL


    They do work by paths. But you're right. If I put an Excel file in the same folder as a bunch of Docs, I'm okay. AND, most people put the files on servers and if everybody's machines are mapped the same, that works too.


    You'll have to explain about "searching a filename" and "duplicates"--just give me a real-life scenario that you envision.

  • Have you ever done a "Regular Expression" type search? I'm afraid I can't come up with a real life scenario, because I haven't figgered out how to do it in MSWindows yet. (It's been on the back burner, but the day will come I need it...) In UNIX environments, it's as simple as executing a shell command to "find filename", with the correct parameters, of course, if the file is in another directory. You can search the entire heirarchy with "find \filename", giving a start-at-root path. Because the shell is written in C, shell commands can be called from programs that are written in C, C++, C#, Perl, etc., any language that'll link to a C module. My situation is this application I need to build in Excel. My boss is crazy, or he'd hire you to do it. Of course, he'd have to pay you. LOL.
    So, let's say we sell the product to someone and set it up with their accounts. Now, they will have Word docs of "plans" that will need to be accessible from the Excel WB. Or, we can include Word files. To be honest, I'm still not completely sure what the boss wants. But, that's the software design business, isn't it? Anyway, if I were doing it in C, it would go something like this:


    Client open file (Excel WB).
    Client does some stuff.
    Client needs some info from this related plan,
    So client clicks graphic object I created in Perl TK. (button)
    Program executes. It has a function that prints to the screen, ie: What file do you want?
    User types in file name. It is scanned into a variable regular expression and found and opened for the user. When they are done reading, printing, perhaps even editing, they click a button and the file closes and returns them to the Excel worksheet they left.


    I know all this can be done with links and such, can't it? I'd rather use buttons and attach macros... Anyway, hopefully this shows you the bigger picture. I could do it in an hour or two with C and Perl, but I'm still a VBAby. I need to take time to study user forms and dialogue boxes... my boss keeps having me do weird stuff like developing filenaming conventions his crew hates and reorganizing directories when I should be learning Excel --
    Well, it's a job!


    Thank you -- and as always -- Any help is good help!!


    AA :thanx:

  • Drop in here:
    http://www.vbaexpress.com/foru…hread.php?p=7088#post7088


    If you can't get the file and don't want to join, I'll email it to you.


    What I'm thinking is you take some version of that *addin* (it's not an addin yet), and you make it so the file you pick is opened as a hyperlink (we do that with another macro) when you click a "Select" or "Go" button.


    I don't do regexp. But brettdj does. If you PM him, and ask him to pop in here, I'm sure he will. If he doesn't respond, lemme know, and I'll grab him.


    :rock:

  • Thank you much. I registered in the other forum, I wasn't sure if that was an invite, but I need all the help I can get. Is Brettdj the same as XLDennis? He's a whipper code snapper, isn't he? One of his programs knocked me bosse's knickers off. I guess I already owe him half a paycheck!! Aya, I was thinking the same thing... Right now I have 'er set up to push a button and hyperlink via macro to a file in the same directory. Can't help digging for another way, though, that allows user input. I still haven't gotter down to simple input and output in Excel, VBA, or anywhere in MS. I won't give up, though, and I thank you again-


    AA :thanx:

  • Quote from ACAnderson

    . Is Brettdj the same as XLDennis? He's a whipper code snapper, isn't he? One of his programs knocked me bosse's knickers off.
    AA :thanx:



    We can but dream.........that I am XLDennis that is


    So are you looking for code where ay
    1) A user types a partial file name say "bob"
    2) All filenames containing "bob" are listed


    If so I'm not sure whether you will need a RegExp for this, it could probably be handled with some string fucntions such as Split and Instr.


    Can you please give an example......


    Cheers


    Dave

  • Thank you for your interest, Brett. I am happy for any help I can get in learning to Excel. I think what you are wanting to show me is some sort of list box thingy? I would love to see that, because I would like to implement something of the sort for our new employees, and I want to run 'er in the directory listings. Can it be done? As for my earlier question, I have the fine line on what me bose wants. Here's the scoop. (There's gotta be a better way!!!) He wants one of the girls to scan this book into Word docs (or PDF, if it helps, I don't know if Excel or VBA talks to PDF). Then, he wants me to link buttons, or whatever, to the docs. He wants it so that the user can type a number into an Excel Worksheet cell and the "program" will take the user to that place in the Word doc. (The section of that number.) I still haven't gotter down this input and output thing with Excel. Follow me? I'm about looking up dialogue boxes, bookmarks and such today. I was thinking on making a table of bookmarks? Again, there's gotta be a better way! Int there? If you haveny ideas, I'm mighty grateful!!!


    AA :thanx:

  • Oh, and about the "bob" thingy. I'd love it if I can make a wildcard, say before and after "bob". Can he find bob outta the middle? Anyway, I'm gonna put me fingers down and me brain in gear...


    Thank all for the help!


    AA :thanx:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!