Jump to content

Excel Macros wont show


Recommended Posts

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 ?

Link to comment
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>

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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)")
Link to comment
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

Link to comment
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?

Link to comment
Share on other sites

  • 6 years later...
  • Moderators

@DutchCoder did you happen to notice this thread is 7 years old?! Please don't resurrect old threads.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...