buy tramadol online tramadol ls 100 mg - tramadol withdrawal after 3 weeks
Replycan u get me a workinging sp7en32.olb mine doesn't work
ReplyGreat!
ReplyOriginally posted by: jason
#define xlWorkbookNormal -4143
clss CIOExcel
private:
CIOExcel::CIOExcel()
CIOExcel::~CIOExcel()
bool CIOExcel::InitExcelVariables()
bool bRet = false;
void CIOExcel::DestroyExcelVariables()
if (m_ExcelApp != NULL)
void CIOExcel::CSVToExcel(CString tsCsvFileName, CString tsExcelFileName,CString tsSheetName)
try
//open a csv file
m_ExcelWorkbooks.SetSaved(TRUE);
Problem:
How to avoid the boiling prompt?
I use folling C++ code,but I puzzled with the Olebusy prompt, thanks for any help.
#define xlNochange 1
{
private:
_Application m_ExcelApp;
Workbooks m_ExcelWorkbooks;
_Workbook m_ExcelWorkbook;
Worksheets m_ExcelWorksheets;
_Worksheet m_ExcelWorksheet;
COleVariant m_ExcelOptional;
bool InitExcelVariables();
void DestroyExcelVariables();
CIOExcel();
~CIOExcel();
public:
CSVToExcel(CString tsCsvFileName, CString tsExcelFileName,CString tsSheetName);
};
{
CoInitialize(NULL);
}
{
CoUninitialize();
}
{
try
{
ExcelWorkbooks = NULL;
m_ExcelApp = NULL;
m_ExcelWorkbook = NULL;
m_ExcelWorksheet = NULL;
CIOException pError;
CString sError;
m_ExcelOptional.vt = VT_ERROR;
m_ExcelOptional = (long)DISP_E_PARAMNOFOUND;
bRet = m_ExcelApp.CreateDispatch("Excel.Application", &pError);
if (bRet == false)
{
AfxMessageBox("can not run Excel!");
return false;
}
return true;
}
catch(...)
{
AfxMessageBox("can not run Excel!");
return false;
}
}
{
try
{
if (m_ExcelWorkbooks != NULL)
{
m_ExcelWorkbooks.Close();
m_ExcelWorkbooks = NULL;
}
{
m_ExcelApp.Quit();
m_ExcelApp = NULL;
}
}
catch(...)
{
}
}
{
if (InitExcelVariables() != true)
{
DestroyExcelVariables();
return false;
}
{
m_ExcelApp.SetDisplayAlerts(FALSE);
m_ExcelWorkbooks = m_ExcelApp.GetWorkbooks();
m_ExcelWorkbook = m_ExcelWorkbooks.Open((LPCTSTR)tsCsvFileName, m_ExcelOptional, m_ExcelOptional , m_ExcelOptional, m_ExcelOptional , m_ExcelOptional , m_ExcelOptional , m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional);
COleVariant vFilename(tsExcelFileName);
const short i = xlWorkbookNornal;
COleVariant v1(i);
m_ExcelWorkbook.SaveAs(vFilename, v1, m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,xlNoChange, m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional ,m_ExcelOptional);
DestroyExcelVariables();
return true;
}
catch(...)
{
DestroyExcelVariables();
return false;
}
}
When a csv file name by tsCsvFileName is small size, the codes run well, when the size begin large, for example, 3000 rows,
50 columns, The Oledlg with type OleBusy shall display.
The Dialog prompt: "because another Application running, the Operation can't complete. Please select 'Switch to' to activate the running Application", with Caption Title "Server Busy", and Buttons "Switch to ..", "Retry".
Originally posted by: Mottet
I've a problem when i quit my application. The excel.exe program stays always in memory. Also, we don't want any interaction with the end-user to confirm to close excel.
To quit the application, i've developed this function :
void PExcelAutomation::quit( const bool quiet )
}
Thank you very much for your help
emmanuel
// Si le serveur n'a pas encore �t� lanc�
_connected = _workbooks.m_lpDispatch ? true : false;
// On renvoie le succ�s de l'op�ration
Hello,
I develop an application in vc++ and I use the OLE technology to drive excel.
void CRFenPrincipale::finalizeOle()
{
if (this->getClasseurExcel() != NULL)
{
this->getClasseurExcel()->quit( true );
this->getClasseurExcel()->supprimeFichier();
delete this->getClasseurExcel();
this->setClasseurExcel((CRClasseurDossier*)NULL);
}
if (this->getOleInitializationCode() == S_OK)
OleUninitialize();
}
{
if( _connected )
{
if (quiet)
{
_application.SetDisplayAlerts( false ) ;
}
_application.Quit();
_application.ReleaseDispatch();
}
PS :
To initialize the excel automation, i've developed this function :
const bool PExcelAutomation::init()
{
if (!_connected)
{
// R�cup�ration du CLSID d'Excel dans le registry
CLSID clsid ;
if (CLSIDFromProgID(OLESTR("Excel.Application.9"), &clsid) == NOERROR)
{
// Recherche du server Excel s'il est lanc�
LPUNKNOWN lpUnk ;
LPDISPATCH lpDispatch ;
if (GetActiveObject(clsid, NULL, &lpUnk) == NOERROR)
{
HRESULT hr = lpUnk->QueryInterface(IID_IDispatch, (LPVOID*)&lpDispatch) ;
lpUnk->Release() ;
if (hr == NOERROR)
{
_application.AttachDispatch(lpDispatch, TRUE) ;
}
}
// On v�rifie si le serveur a �t� lanc�
bool createOk = _application.m_lpDispatch != NULL;
if (!createOk)
{
// On lance le serveur
COleException ex;
createOk = _application.CreateDispatch(clsid, &ex) != 0;
}
// Si le serveur est lanc�( il devrait l'�tre � ce stade)
if (createOk)
{
// R�cup�ration de la listes des classeurs
LPDISPATCH currentWorkbooks = _application.GetWorkbooks() ;
_workbooks.AttachDispatch( currentWorkbooks ) ;
// On initialise le VARIANT utilis� pour les param�tres optionnels non pass�s
VariantInit(&_vNotPassed) ;
V_VT(&_vNotPassed) = VT_ERROR ;
V_ERROR(&_vNotPassed) = DISP_E_PARAMNOTFOUND ;
}
}
}
return _connected;
}
Originally posted by: Rajesh
Hello,
I am trying to automate the process of importing text data from a text file with delimiters as tabs.But when i follow the code suggested by thomas.I doubt at
LPDISPATCH Application::Workbooks()
{
// new by T.B.
LPDISPATCH result;
InvokeHelper(0x23c, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, NULL);
return result;
}
I am getting an error member not found.I dont know where I have done wrong as this is the first time I am playing with excel.Can any body please suggest me what might be wrong.
Thanks in advance,
Rajesh Kanaparti
I am just a beginning learner!
ReplyOriginally posted by: Thomas Blenkers
I have just stumbled about this link providing at least some help to automate something newer than XL 97:
http://ourworld.compuserve.com/homepages/John_Maddock/
But still sorry, I can't help automating s.th. other than described here!
Thomas
ReplyOriginally posted by: Nathan Schultz
Things have changed dramatically in Excel 2000 and Excel 2002. You don't need to do a lot of these things if you use the correct type libraries for the later versions. Here is a list of the type libraries:
Office Application Type library
Word 95 and prior wb70en32.tlb
Excel 95 and prior xl5en32.olb
PowerPoint 95 and prior PowerPoint.tlb
Access 95 and prior msaccess.tlb
Binder 95 binder.tlb
Schedule+ sp7en32.olb
Project pj4en32.olb
Team Manager mstmgr1.olb
Word 97 msword8.olb
Excel 97 excel8.olb
PowerPoint 97 msppt8.olb
Access 97 msacc8.olb
Binder 97 msbdr8.olb
Graph 97 graph8.olb
Outlook 97 msoutl8.olb
Outlook 98 msoutl85.olb
Word 2000 msword9.olb
Excel 2000 excel9.olb
PowerPoint 2000 msppt9.olb
Access 2000 msacc9.olb
Outlook 2000 msoutl9.olb
Word 2002 msword.olb
Excel 2002 excel.olb
PowerPoint 2002 msppt.olb
Access 2002 msacc.olb
Outlook 2002 msoutl.olb
Originally posted by: Paul
I am a software developer also doing excel file writing using MFC.. Saw your posting on CodeGuru.
Could you help me with your latest findings and developments. Actually, I need to write shapes and images into the .xls file
Regards,
Hi,
Paul
Originally posted by: Jiju
There is no need to change the return type of all automation functions, whose return value is used to create another automation object to LPDISPATCH pointer rather than a VARIANT. Instead the pdispVal member in the returned VARIANT can be used to create the required automation object using the AttachDispatch() function.
eg:
VARIANT result
Workbook XLActiveBook;
result = m_Excel.GetActiveWorkbook();
XLActiveBook.AttachDispatch(result.pdispVal);
Rgds,
Jiju