Sign in to follow this  
Followers 0
alfa

Excel Macros wont show

15 posts in this topic

Hello,

I have a problem with seeing the excel macros that i have in my personal.xlsb file when i open it with this line. I am using office 2010.

_ExcelBookOpen ("c:\Documents and Settings\aozben\Desktop\Cap Rep\TK_LO_Cap_Rep.xls")

Is there a work around for this ?

Share this post


Link to post
Share on other sites



Not knowing much about your problem, one thing stands out. You say you have a problem with opening "personal.xlsb" but your script shows you trying to open "TK_LO_Cap_Rep.xls".

I tested to see if the UDF opens an xlsb extension and it does. My only conclusion is that you are not giving the script the correct path to your file. Check it again. And make sure you are getting the extension right.


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

personal.xlsb is the file that is in XLstart directory where you store the macros. That file autoloads normally. But not when i run excel with _ExcelBookOpen command.

Share this post


Link to post
Share on other sites

Please show your code. Is your Excel security and Macrio settings low ?

Share this post


Link to post
Share on other sites

The code doesnt matter, even if you make a one line code like the one in the first post , it doesnt show the macros. I will checkt the excel security settings.

Share this post


Link to post
Share on other sites

I have excel 2007 and it works for me. I can show you how you can insert and execute a macro from a file.

Share this post


Link to post
Share on other sites

Yes i would love to get some help. I am using 2010.

Share this post


Link to post
Share on other sites

$oExcel = ObjCreate("Excel.Application")
    $oExcel.Visible = 1
    $oExcel.WorkBooks.Open("C:\2010.xls")
    $oModules = $oExcel.ActiveWorkbook.VBProject.VBComponents
    For $oModule in $oModules
        ConsoleWrite($oModule.Name&@CRLF)
    Next
     $oModules.Import("C:\Module1.bas")
     $oExcel.Run("Macro1",$date2,$FileName3) ;my macro accepts parameters
     $oExcel.ActiveWorkbook.Save
     $oExcel.ActiveWorkbook.Close

This is how i import and run a macro.

Share this post


Link to post
Share on other sites

Hmm, what i was referring is , you know you get a list of the macros you have in your xlsb file under XL start when ypu press alt+f8. So some how it is not starting the file under xlstart. when i use the _ExcelBookopen.

Share this post


Link to post
Share on other sites

Yea , i get it , but it starts on my Excel 2007 so it should be an Excel configuration or something similar.

Maybe the security and trust center settings needs to be lowered. As a workaround you may use the exmaple for inserting macros.

Share this post


Link to post
Share on other sites

Hey guys.

This got me very close to what I'm trying to do here.

I want to hide the Ribbon (Office 2007), kind of full screen mode, so all I'd have would be the Excel cell grid.

I suppose this would allow me to integrate an Excel grid in an AutoIt GUI.

This is what I use:

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

However, passing this action to the Excel object produces no changes.

Importing and then running the Macro (as shown in the post above) returns an error.

After the error, when I choose to debug, if I stop and rerun that macro, the Ribbon becomes hidden successfully.

Any thoughts?

Thanks in advance for your time,

footswitch


Share this post


Link to post
Share on other sites

Hey guys.

This got me very close to what I'm trying to do here.

I want to hide the Ribbon (Office 2007), kind of full screen mode, so all I'd have would be the Excel cell grid.

I suppose this would allow me to integrate an Excel grid in an AutoIt GUI.

This is what I use:

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

However, passing this action to the Excel object produces no changes.

Importing and then running the Macro (as shown in the post above) returns an error.

After the error, when I choose to debug, if I stop and rerun that macro, the Ribbon becomes hidden successfully.

Any thoughts?

Thanks in advance for your time,

footswitch

This is not exactly what the OP's problem was however try:

#include <Excel.au3>
$oExcel = _ExcelBookOpen(@DesktopDir & "\test.xls", 1)
$oExcel.ExecuteExcel4Macro ("SHOW.TOOLBAR(""Ribbon"",False)")

Share this post


Link to post
Share on other sites

@JoHanatCent

Thanks for your reply. Yes, it's almost off-topic. Sorry about that.

Please tell me, did you try this code yourself?

With it, Excel 2007 returns this error (translated from Portuguese): "there's an error with your formula (...)".

In fact, before messing around with Macro files, I've tried several variations of that command, all to no avail.

The Macro Import method really seems to be the closest to success - in such a way that it works fine when called from Excel itself, but doesn't when called via COM.

footswitch


Share this post


Link to post
Share on other sites

@JoHanatCent

Thanks for your reply. Yes, it's almost off-topic. Sorry about that.

Please tell me, did you try this code yourself?

With it, Excel 2007 returns this error (translated from Portuguese): "there's an error with your formula (...)".

In fact, before messing around with Macro files, I've tried several variations of that command, all to no avail.

The Macro Import method really seems to be the closest to success - in such a way that it works fine when called from Excel itself, but doesn't when called via COM.

footswitch

Yes I did.

Maybe there is a Portuguese word for "Ribbon" Used?


Share this post


Link to post
Share on other sites

Well I've tried "Friso" as well, but doesn't work either.

If it works for you and not for me I have to accept that this method wouldn't be reliable anyway.

Nevertheless, thanks again for your help.

Regards,

footswitch


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0