I was wondering if there was a way to open anouther workbook through a button?
opening another excel workbook through a button
Collapse
X
-
Sure,
use something like
dim Obj1 as object
set obj1 = createobject("e xcel.applicatio n")
obj1.visible=tr ue
obj1.workbooks. open("c:\file1. xls")
You can use file pickers or something else to make it look pro
Why dont you check out some other similar questins, you may find some nice things you can use.
Good Luck
Kad -
Is there a way to have the file path to just look in the same folder that the first file is in. For example: first file will access the second file through a button. if i email these two file and tell the person to put both of the files into a folder and it still will work. that is what i'm trully looking for.Comment
-
Originally posted by golf32902Is there a way to have the file path to just look in the same folder that the first file is in. For example: first file will access the second file through a button. if i email these two file and tell the person to put both of the files into a folder and it still will work. that is what i'm trully looking for.
[CODE=vb]
dim path as string
with application.fil edialog(msoFile DialogFilePicke r)
.allowmultisele ct = false
.filters.clear
.filters.add "Excel files (*.xls)", "*.xls"
if .selecteditems. count>0 then
path = .selecteditems. initialfilename 'im not realy sure about this
'one but there is for sure a property
'that gives you the path
'and place here the code for oppening the path & selecteditems.i tem(1)
end if
end with[/CODE]
And now, for opening file2.xls just open(path & "file2.xls)
It should be something like that
Good luckComment
Comment