open exisiting workbook from another workbook problem

ionman99

New Member
Joined
Apr 24, 2015
Messages
4
Hi
I have a form in a workbook "tools.xlsx" that I use to enter data into a worksheet . I need to open another excel workbook to enter more data.
I can open a new workbook fine using a 'getopenfilename' method from my userform. Opens the file fine but the new workbook is stuck behind my 'Tools' worksheet and I can't add data. I tried to activate the workbook and that didnt work either.
Am i going to have trouble opening a workbook when i still have a userform open in "tools.xlsx"

Thanks Dave
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It sounds like you will need to make your form such that it is not "modal". A modal userform means you cannot activate any other windows while the userform is open.

See (just a little ways down):
Microsoft Excel VBA - Lesson 08: Introduction to Forms

That won't necessarily make it the workbook the active window, but it might ... I'm not sure so test and see.


Note:
I think the more common way here (rather than in the show method arguments) is to set the property for the userform design. See:
http://www.bettersolutions.com/vba/VXV113/SE846743531.htm
 
Upvote 0
So I now have it that I can open an existing workbook , while the form is still open. I can write and edit the workbook no problem. Only issue is that the new workbook is read only.
I tried
Workbooks.Open Filename, Editable = True
and
Workbooks.Open Filename, readonly = False

I havent been able to activate my workbook with

workbooks(Filename).Activate

Anything else I should try ?
 
Upvote 0
You will have to post more of your code. I'm not sure. I would think if the workbook is not active, you can activate it by just clicking it. Forms and workbooks are not the same thing, so there are some things you can't do in a form the same way you can do in a workbook. If your workbook is read only it can be for many reasons. But clearly something is making it read only. First see if it is that way when you open it by itself. If it is, then its something about the workbook settings.
 
Upvote 0
Xenou , you were absolutely right. I never even thought to check the file if it was' read only '. I had copied it to a separate Dir for testing. Somehow the copy turned into a read only file. Thanks again , my workbooks and forms are working great..
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,296
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top