alfa Posted June 1, 2011 Share Posted June 1, 2011 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 More sharing options...
sleepydvdr Posted June 1, 2011 Share Posted June 1, 2011 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 More sharing options...
alfa Posted June 1, 2011 Author Share Posted June 1, 2011 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 More sharing options...
Juvigy Posted June 6, 2011 Share Posted June 6, 2011 Please show your code. Is your Excel security and Macrio settings low ? Link to comment Share on other sites More sharing options...
alfa Posted June 7, 2011 Author Share Posted June 7, 2011 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. Link to comment Share on other sites More sharing options...
Juvigy Posted June 7, 2011 Share Posted June 7, 2011 I have excel 2007 and it works for me. I can show you how you can insert and execute a macro from a file. Link to comment Share on other sites More sharing options...
alfa Posted June 15, 2011 Author Share Posted June 15, 2011 Yes i would love to get some help. I am using 2010. Link to comment Share on other sites More sharing options...
Juvigy Posted June 15, 2011 Share Posted June 15, 2011 $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 More sharing options...
alfa Posted June 15, 2011 Author Share Posted June 15, 2011 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 More sharing options...
Juvigy Posted June 16, 2011 Share Posted June 16, 2011 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 More sharing options...
footswitch Posted July 8, 2011 Share Posted July 8, 2011 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 More sharing options...
JoHanatCent Posted July 8, 2011 Share Posted July 8, 2011 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 More sharing options...
footswitch Posted July 8, 2011 Share Posted July 8, 2011 @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 More sharing options...
JoHanatCent Posted July 8, 2011 Share Posted July 8, 2011 @JoHanatCentThanks 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.footswitchYes I did.Maybe there is a Portuguese word for "Ribbon" Used? Link to comment Share on other sites More sharing options...
footswitch Posted July 8, 2011 Share Posted July 8, 2011 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 Link to comment Share on other sites More sharing options...
DutchCoder Posted April 6, 2018 Share Posted April 6, 2018 Try this: $oExcel.Application.ExecuteExcel4Macro('SHOW.TOOLBAR("Ribbon",False)') Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 6, 2018 Moderators Share Posted April 6, 2018 @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 More sharing options...
DutchCoder Posted April 9, 2018 Share Posted April 9, 2018 I needed it myself and found out it was never soveld on the forums... See my rebuilt notepad replacement into Excel replacement by rewriting three lines of code. (Ribbon code in plain GDI is not available. sorry) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 9, 2018 Moderators Share Posted April 9, 2018 That doesn't change that you should have created a new topic. "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 More sharing options...
Recommended Posts