Link to home
Start Free TrialLog in
Avatar of Jeff McClellan
Jeff McClellanFlag for United States of America

asked on

Excel opens from .xls file without PERSONAL.xls available - how to overcome this?

I have a database program that will "print" (ie. export) query results to an Excel file.  Problem is that the instance of Excel that this database opens does not have access to PERSONAL.xlsb, so I can't run any of my macros on the generated .xlsx file.  I have to save the file,  restart Excel, and re-open the file to use PERSONAL.xlsb.

How do I overcome this so Excel has access to my macros when the file is created?
Avatar of byundt
byundt
Flag of United States of America image

PERSONAL.xlsb will be automatically opened if it is in the XLSTART folder. It will also be opened if you put it in a folder specified in the File...Options...Advanced tab in the "At startup, open all files in:" field (about 80% down the dialog). Try putting the path to your PERSONAL.xlsb macro in that field in the instance of Excel that opens when the database exports the query results.

Alternatively, create a macro in that other instance and make sure that it is saved to its PERSONAL.xlsb workbook. Edit that macro so it contains the following statement:
MsgBox ThisWorkbook.FullName
When you close Excel, make sure that the newly created PERSONAL.xlsb is saved. Then do the database program "print" operation once again and see where the PERSONAL.xlsb is located. You can then copy your macros into that other PERSONAL.xlsb
Avatar of Jeff McClellan

ASKER

When I try to record a macro to Personal  I get an error message "Personal Macro Workbook in the startup folder must stay open for recording".  Click OK, get "Unable to record" error.

This instance of Excel was started by the .xlsx output from the database program.
When I try to set the startup file path in Options - Advanced, the changes are not saved.  
- They aren't saved to the instance of Excel that launches when starting Excel normally,
- or by starting Excel from the database.
That sounds like policy settings are preventing Excel from writing to the registry.

Is the instance of Excel that opens up a network version of Excel? If so, perhaps you could talk to your network admin to get PERSONAL.xlsb where it needs to be.
No network involved.  This all happens on my PC.  The db software that generates the file and opens the restricted version of Excel is based on FoxPro I think.
Do you have Admin privileges on your computer? If not, consider acquiring them so you can get the database-launched version of Excel to use your PERSONAL.xlsb. You can revert back to non-Admin status once that has been accomplished.
I'm the only user, and the administrator
Perhaps this is a problem that can be solved from the database side of things. I suggest that you add it to the topic areas this question is seen in.

If the database program is running a VBA macro, could you post that?
Do you have code in the ThisWorkbook module of Personal.xslb? There might be code in the Open event that close the file or does something else so that it is not accessible.
ASKER CERTIFIED SOLUTION
Avatar of Jeff McClellan
Jeff McClellan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This was solved on the software that launched Excel.  Needed a switch when excel started that allowed access to the personal.xls.